apache / pinot

Apache Pinot - A realtime distributed OLAP datastore
https://pinot.apache.org/
Apache License 2.0
5.5k stars 1.29k forks source link

[Feature Request] Alias column in schema (virtual column) #11477

Open egalpin opened 1 year ago

egalpin commented 1 year ago

It would be nice to have the ability to define in the schema a virtual or alias column which simply causes a different physical column to be fetched at query time. This would mirror the exact same functionality as SELECT foo AS bar, except that assigning the alias at query time would not be required. It would be required that any alias column could not share a name with a physical column.

In particular, this feature would allow for the support of a UNION like operation when combined with the notion of table aliasing[1].

[1] https://github.com/apache/pinot/issues/10712

Jackie-Jiang commented 1 year ago

Can you elaborate more on this:

In particular, this feature would allow for the support of a UNION like operation when combined with the notion of table aliasing.

An example query can be very helpful