Hacker News new | ask | show | jobs
by nevi-me 2789 days ago
I had a quick look at some online material on implementations of pivot, as well as what I consider my go-to reference [0] for Apache projects' SQL support (Apache Calcite).

Looks like each DB has a proprietary way of pivoting, and I couldn't find anything on pivot in Calcite. Does anyone know if the SQL impl of pivot was created specifically for Spark, or whether it'd be upstreamed to Calcite? The benefit would be that other projects that rely on Calcite for SQL support would also have pivot capabilities. I'm thinking of Apache Beam.

- [0] https://calcite.apache.org/docs/reference.html

2 comments

This article enlightened me on the underlying logic, as well as some different implementations. https://modern-sql.com/use-case/pivot
I was lazy to add its link, that's where I learnt about the proprietary implementations of various databases.

I wonder if we'll ever get an ANSI-2019 SQL version that tries to merge what various DB vendors have branched off and done. Maybe it already exists? https://www.whoishostingthis.com/resources/ansi-sql-standard...

Apache Spark doesn't use Calcite.