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/14 09:23:00 UTC

[jira] [Updated] (CALCITE-5779) Implicit column alias for single-column table function does not work

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

Dmitry Sysolyatin updated CALCITE-5779:
---------------------------------------
    Description: 
Implicit column alias for single-column table function works only for UNNEST. But should work for every table function.

For example, PostgreSQL returns the same result for
{code:java}
SELECT i FROM UNNEST(ARRAY(1,2)) as i;
SELECT i FROM generate_series(1,2) as i;

 i 
---
 1
 2
(2 rows)
{code}
But calcite throws "Column 'i' not found in any table" exception for
{code:java}
SELECT i FROM generate_series(1,2) as i
{code}

  was:
Implicit column alias for single-column table function works only for UNNEST. But should work for every table function.

For example, PostgreSQL returns the same result for
{code:java}
SELECT i FROM UNNEST(ARRAY(1,2)) as i;
SELECT i FROM generate_series(1,2) as i;

 i 
---
 1
 2
(2 rows)
{code}
Calcite throws"Column 'i' not found in any table" exception for
{code:java}
SELECT i FROM generate_series(1,2) as i
{code}


> Implicit column alias for single-column table function does not 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
>            Priority: Major
>
> Implicit column alias for single-column table function works only for UNNEST. But should work for every table function.
> For example, PostgreSQL returns the same result for
> {code:java}
> SELECT i FROM UNNEST(ARRAY(1,2)) as i;
> SELECT i FROM generate_series(1,2) as i;
>  i 
> ---
>  1
>  2
> (2 rows)
> {code}
> But calcite throws "Column 'i' not found in any table" exception for
> {code:java}
> SELECT i FROM generate_series(1,2) as i
> {code}



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