我一直在尝试构建我的U-SQL脚本,我甚至使用了下面的例子:
CREATE ASSEMBLY IF NOT EXISTS [Newtonsoft.Json] FROM "assemblies/Newtonsoft.Json.dll";
CREATE ASSEMBLY IF NOT EXISTS [Microsoft.Analytics.Samples.Formats] FROM "assemblies/Microsoft.Analytics.Samples.Formats.dll";
REFERENCE ASSEMBLY [Newtonsoft.Json];
REFERENCE ASSEMBLY [Microsoft.Analytics.Samples.Formats];
DECLARE @INPUT_FILE string = @"/Samples/Data/json/donut.json";
//Extract the sps property from the Json file as a string.
@json =
EXTRACT sps string
FROM @INPUT_FILE
USING new Microsoft.Analytics.Samples.Formats.Json.JsonExtractor();
@json =
SELECT sps.Replace("\r\n", "") AS sps
FROM @json;
/*
Parse the sps property to extract the id and name values as a SQL.MAP
*/
@sps_json =
SELECT Microsoft.Analytics.Samples.Formats.Json.JsonFunctions.JsonTuple(sps, "$..id") AS sp_id_map,
Microsoft.Analytics.Samples.Formats.Json.JsonFunctions.JsonTuple(sps, "$..type") AS sp_type_map
FROM @json;
/*
Explode the id and type maps to get the values of the Id and type as individual rowsets
*/
@sps_id_property =
SELECT id_name.Split('.')[0] AS id_name,
id_value
FROM @sps_json
CROSS APPLY
EXPLODE(sp_id_map) AS T(id_name, id_value);
@sps_type_property =
SELECT type_name.Split('.')[0] AS type_name,
type_value
FROM @sps_json
CROSS APPLY
EXPLODE(sp_type_map) AS T(type_name, type_value);
/*
JOIN the Id and Value maps to return the properties as a rowset
Output of the following JOIN statement
1001,Regular
1002,Chocolate
1003,Blueberry
1004,Devil's Food
*/
@sps = SELECT [id].id_value AS id, [type].type_value AS type
FROM @sps_id_property AS [id]
INNER JOIN @sps_type_property AS [type]
ON id.id_name == type.type_name;
/*
Output the file.
*/
OUTPUT @sps
TO "/rukmanig/output/sps.csv"
USING Outputters.Csv(quoting : false);
然而,当我构建它时,我收到以下错误:
E_CSC_USER_NOTAUTHORIZED:此声明需要数据库'master'的USE权限
我不知道为什么我有这个。我的另一位同事在构建同一个项目时没有任何问题。我以前能够建造,但由于某种原因我不能再建造了。
有人知道为什么吗?
感谢。
答案 0 :(得分:0)
我认为你已经能够解决它。但在我们引入文件和文件夹以及数据库级ACL之后,现有帐户上的现有用户需要在master数据库上获得显式权限。
新添加的用户或新创建的帐户应自动执行。