问题
Let's say I have a JSON object coming into an Azure Stream Analytics job:
{
"coordinates":{
"type":"Point",
"LongLat":[
115.17348,
-8.72263
]
},
}
I could do the following to get the individual values of "Long" and "Lat"?
Could I do the following to isolate the array value [115.17348, -8.72263]:
Select coordinates.longlat
However I'm having trouble just grabbing individual elements of the array. I've seen fuzzy documentation on the web about GetArrayElement(), stream analytics keeps saying "GetArrayElement is either not supported or not usable in this context".
回答1:
GetArrayElement function will be available on 07/30 as well as documentation describing how to use it. In your case it will look like this
SELECT GetArrayElement(coordinates.longlat, 0) as long, GetArrayElement(coordinates.longlat, 1) as lat
来源:https://stackoverflow.com/questions/31602577/accessing-array-elements-in-azure-stream-analytics