You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Dmitry Sysolyatin (Jira)" <ji...@apache.org> on 2023/06/22 06:15:00 UTC

[jira] [Resolved] (CALCITE-5779) Implicit column alias for single-column table function should work

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

Dmitry Sysolyatin resolved CALCITE-5779.
----------------------------------------
    Fix Version/s: 1.35.0
       Resolution: Fixed

Fixed in {{[2826a1c|https://github.com/apache/calcite/commit/2826a1c5c5df691a29427ba3eba6c6715e103045]}} . Thanks for review [~jiajunbernoulli] !

> Implicit column alias for single-column table function should work
> ------------------------------------------------------------------
>
>                 Key: CALCITE-5779
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5779
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.34.0
>            Reporter: Dmitry Sysolyatin
>            Assignee: Dmitry Sysolyatin
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.35.0
>
>
> Implicit column alias for single-column table function works only for UNNEST at the moment. But should work for every table function.
> For example, PostgreSQL:
> {code:java}
> CREATE OR REPLACE FUNCTION fun() 
>     RETURNS TABLE(col int)
>    AS
> $$
> SELECT 1
> $$ LANGUAGE 'sql' VOLATILE;
> SELECT f.col, f FROM fun() as f;
>  col | f 
> -----+---
>    1 | 1
> (1 row)
> SELECT * FROM fun() as f;
>  col 
> -----
>    1
> (1 row)
> SELECT f FROM fun() as f;
>  f 
> ---
>  1
> (1 row){code}
>  
> Calcite throws "Column 'i' not found in any table" exception for
> {code:java}
> SELECT i FROM table(generate_series(1,2)) as i
> {code}
> Where generate_series is user defined table function.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)