Hi,
I tried to use UNPIVOT but it doesn’t work. Is UNPIVOT supported? And if not, are there any plans to support it?
Background: This is often required in IoT scenarios where JSON based sensor data needs to be processed. e.g. you often get something like
sensorXYZ:1234 >> [sensor]:[value]
instead you want defined field names like this
sensor:"sensorXYZ", value:1234
UNPIVOT is the (default) way out…
here’s my query…
Select
u.dir0 ,
u.dir1 ,
u.dir2 ,
u.co,
u.t,
u.EventProcessedUtcTime,
u.partitionId,
u.sensor, u.val
FROM eventhub_data
unpivot
(
val for sensor in (
SensorA,
SensorB,
…,
SensorZ
)
) u;