Mihai Budiu created CALCITE-7602:
------------------------------------
Summary: ROW(*) loses column names
Key: CALCITE-7602
URL: https://issues.apache.org/jira/browse/CALCITE-7602
Project: Calcite
Issue Type: Bug
Components: core
Affects Versions: 1.42.0
Reporter: Mihai Budiu
The newly-introduced ROW(*) and ROW(* EXCLUDE(cols)) constructors create a new
ROW-valued column. However, the newly introduced ROW does not preserve the
columns of the original table as field names.
{code:java}
SELECT R.deptno FROM (SELECT ROW(*) AS R FROM emp); {code}
will produce an error:
{code:java}
Column R.deptno not found {code}
The column names could be preserved by generating a CAST to an appropriate ROW
type, by rewriting the inner expression as:
{code:java}
SELECT CAST(ROW(*) AS ROW(...columns of emp...)) AS R {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)