Accessing Array Elements in Azure Stream Analytics

拥有回忆 提交于 2019-12-11 19:38:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!