coral
coral copied to clipboard
Append 2 AS operators in SqlNode representation for LATERAL VIEWS
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?
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.