[ 
https://issues.apache.org/jira/browse/CALCITE-7602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mihai Budiu resolved CALCITE-7602.
----------------------------------
    Fix Version/s: 1.43.0
       Resolution: Fixed

Fixed in 
[https://github.com/apache/calcite/commit/e7ec483951f25838f5f561e919791714ce2c7ccb]

Thank you for the review [~xuzifu666] 

> 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
>              Labels: pull-request-available
>             Fix For: 1.43.0
>
>
> 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