Map Array in Stream Analytics

Ingo Busse 1 Reputation point
2020-07-02T10:28:28.27+00:00

Is it possible to map an array contained in a message via the geospatial functions?

{
"id": "<msgid>",
"location": {50.2, 30.3},
"geofences": [{"name": xxx, "polygon": <polygon1>},{"name": "yyy", "polygon": <polygon2>}]
}

I.e. to get all names the location is inside? But not as separate messages but in this one.

Azure Stream Analytics
Azure Stream Analytics

An Azure real-time analytics service designed for mission-critical workloads.

0 comments No comments

1 answer

Sort by: Most helpful
  1. HimanshuSinha 19,637 Reputation points Microsoft Employee Moderator
    2020-07-07T19:41:45.623+00:00

    Hello @IngoBusse-2268 ,

    Thanks for the question . Just wanted to check if you have tried the option of something like .

    SELECT location,
    GetArrayElement(geofences, 0) AS fence1,
    GetArrayElement(geofences, 1) AS fence2,
    GetArrayElement(geofences, 2) AS fence3
    FROM ...

    Use GetarrayElement https://learn.microsoft.com/en-us/stream-analytics-query/getarrayelement-azure-stream-analytics.

    Thanks Himanshu

    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.