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

[jira] [Comment Edited] (CALCITE-5749) Join table with different database name and same table name will throw exception

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

xiong duan edited comment on CALCITE-5749 at 6/7/23 1:34 AM:
-------------------------------------------------------------

This is a valid SQL. So it's a bug in Calcite. When we use different table names, It can be executed successfully. Like:
{code:java}
select * from test1.tablea,test2.tableb{code}
The SQL will throw the same exception:
{code:java}
select * from test1.tablea join test2.tablea on true{code}


was (Author: nobigo):
This is a valid SQL. So it's a bug in Calcite. When we use different table names, It can be executed successfully. Like:
{code:java}
select * from test1.tablea,test2.tableb{code}

> Join table with different database name and same table name will throw exception
> --------------------------------------------------------------------------------
>
>                 Key: CALCITE-5749
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5749
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.34.0
>            Reporter: xiong duan
>            Assignee: xiong duan
>            Priority: Major
>
> When we execute SQL:
> {code:java}
> select * from test1.tablea,test2.tablea {code}
> Calcite will throw exception:
> {code:java}
> Duplicate relation name 'tablea' in FROM clause {code}
> Because when we generate alias for this table, just use the last value in the names.



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