Is pivot/unpivot (like in SQL Server / ORACLE) supported?
I am looking for an example for an omnisql query which does something like in this example
https://www.oracle.com/technical-resources/articles/database/sql-11g-pivot.html
Thanks for your kind support.
Best regards,
-
HI @kimgiftww ,
Welcome to the community!
We haven't PIVOT or UNPIVOT function on our database, but you can "emulate" them if you know the values in advance
e.g.
select uniquecarrier, round(avg(case when flight_dayofweek = 1 then depdelay else null end),1) as mon, round(avg(case when flight_dayofweek = 2 then depdelay else null end),1) as tue, round(avg(case when flight_dayofweek = 3 then depdelay else null end),1) as wed, round(avg(case when flight_dayofweek = 4 then depdelay else null end),1) as thu, round(avg(case when flight_dayofweek = 5 then depdelay else null end),1) as fri, round(avg(case when flight_dayofweek = 6 then depdelay else null end),1) as sat, round(avg(case when flight_dayofweek = 7 then depdelay else null end),1) as sun From flights_2008_7m group by 1;
Regards, Candido
-
Hi,
Thanks for taking it to consideration. I am currently do it with pandas and was looking for a way to do it using GPU. (Will also try Dask or other parallelisation tools)
As I was using heavydb as our data warehouse, I thought this was something we could do it during the data transformation process.
Doing the pivot in python would require exporting the whole data to fit into cuDF and this may be something we could not afford.
We would like to utilise and rely on the layer (gpu ram disk) optimization that HeavyDB provides.
Please sign in to leave a comment.
Comments
6 comments