coral icon indicating copy to clipboard operation
coral copied to clipboard

Append 2 AS operators in SqlNode representation for LATERAL VIEWS

Open aastha25 opened this issue 2 years ago • 1 comments

For RelNode -> SqlNode translations for SQLs with LATERAL VIEW UNNEST(..), Coral only appends one (inner) AS operator. The output SqlNode generated looks like - SELECT t0.ccol .... LATERAL VIEW UNNEST(col) AS t0 (ccol)...

However, the same underlying code in Calcite appends 2 AS operators in the following fashion - SELECT t00.ccol .... LATERAL VIEW UNNEST(col) AS t0 (ccol) AS t00....

Why does Coral deviate and is it possible to follow the original Calcite syntax in Coral?

aastha25 avatar Sep 01 '22 19:09 aastha25

Also, when an input hive SQL with LATERAL VIEW UNNEST(..) is converted to CoralSqlNode, it is represented using one AS operator. We should also represent this CoralSqlNode using 2 AS operators for consistency and symmetry.

aastha25 avatar Oct 21 '22 18:10 aastha25