[ 
https://issues.apache.org/jira/browse/CALCITE-7602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18088418#comment-18088418
 ] 

Mihai Budiu commented on CALCITE-7602:
--------------------------------------

Related issues: CALCITE-7364 CALCITE-7311

> 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
>            Priority: Minor
>
> 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)

Reply via email to