Is UNPIVOT supported in Dremio?

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;

2 Likes

Currently PIVOT and UNPIVOT are not supported, but thank you for the suggestion and sharing your use case.

What form does your data take? Is it a text file with a series these key pairs and value pairs? Can you share a sample?

2 Likes