The PIVOT clause is useful for side-by-side comparison of data. In SQL Frames a Pivot DataFrame can be created from an existing Grouped DataFrame.
The SQL PIVOT clause is severely lacking compared to the flexibility available in SQL Frames. Hence, currently the SQL transpilation is only for the associated Grouped DataFrame.
Any DataFrame can be converted to a Hierarchical DataFrame
including Pivot DataFrames. Just calling
hdf() on an existing Pivot DataFrame, it is converted
to a Hierarchical Pivot DataFrame. All the non-pivoted columns are automatically used to create
Order By Pivot Columns
By default the pivot columns are ordered in ascending order of the pivot column
fields. It is possbile to change the order using the
orderBy API supports specifying sort on multiple columns