我正在尝试从Data Lake商店中提取数据,这些数据保存在json中。当我尝试提交脚本时,我收到错误:
顶点故障触发了快速作业中止。顶点失败: 带错误的SV1_Extract [0]:顶点用户代码错误。
我将添加我使用的: https://github.com/Azure/usql/tree/master/Examples/DataFormats/Microsoft.Analytics.Samples.Formats
REFERENCE ASSEMBLY [jsonextr];
REFERENCE ASSEMBLY [Newtonsoft.Json];
@searchlog =
EXTRACT city string
FROM "/weather/logs/2016/09/23/08_0_a26cf4d21dd24f53b7903a9206195c58.json"
USING new Microsoft.Analytics.Samples.Formats.Json.JsonExtractor();
@res =
SELECT *
FROM @searchlog;
OUTPUT @res
TO "/datastreamanalitics/SearchLog-from-Data-Lake.json"
USING new Microsoft.Analytics.Samples.Formats.Json.JsonOutputter();
JSON:
{"city":{"id":7532702,"name":"Brodnica","coord":{"lon":19.406401,"lat":53.2579},"country":"PL","population":0},"cod":"200","message":0.0067,"cnt":1,"list":[{"dt":1474624800,"temp":{"day":15.97,"min":10,"max":17.14,"night":10.01,"eve":17.02,"morn":10},"pressure":1025.32,"humidity":79,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"speed":3.22,"deg":271,"clouds":32}],"EventProcessedUtcTime":"2016-09-23T08:04:06.9372695Z","PartitionId":0,"EventEnqueuedUtcTime":"2016-09-23T08:04:05.2300000Z"}