I am doing a POC on ingesting a JSON though EventHub, processing it through Stream job and pushing it into a Azure SQL DW.
I have worked with JSON ingestion before but the difficulty I face now is with the naming structure used in JSON.
Here is the sample:
{
"1-1": [{
"Details": [{
"FirstName": "Super",
"LastName": "Man"
}
]
}
]
}
The root element has a hyphen (-) and I am having tough time parsing through this element to access the relevant items.
I have tried the following queries and I get NULLs in the SQL tables it outputs to:
--#1
SELECT
["2-1"].Details.FirstName AS First_Name
,["2-1"].Details.LastName AS Last_Name
INTO
[SA-OUTPUT]
FROM
[SA-INPUT]
--#2
SELECT
[2-1].Details.FirstName AS First_Name
,[2-1].Details.LastName AS Last_Name
INTO
[SA-OUTPUT]
FROM
[SA-INPUT]
--#3
SELECT
2-1.Details.FirstName AS First_Name
,2-1.Details.LastName AS Last_Name
INTO
[SA-OUTPUT]
FROM
[SA-INPUT]
--#4
SELECT
SA-INPUT.["2-1"].Details.FirstName AS First_Name
,SA-INPUT.["2-1"].Details.LastName AS Last_Name
INTO
[SA-OUTPUT]
FROM
[SA-INPUT]
Would appreciate the correct way to do this.
Thanks in advance.