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

Julian Hyde edited comment on CALCITE-7940 at 11/15/26, 7:54 PM:
-----------------------------------------------------------------

Good one!

At least one of your test queries should use {{{}SELECT *{}}}. When star is 
expanded, it should only include one copy of the {{USING}} column. There's a 
potential for off-by-one during that expansion.


was (Author: julianhyde):
Good one!

> AssertionError when selecting a common column of three tables joined with 
> USING
> -------------------------------------------------------------------------------
>
>                 Key: CALCITE-7940
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7940
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Sergey Nuyanzin
>            Assignee: Sergey Nuyanzin
>            Priority: Major
>              Labels: pull-request-available
>
> example of query
> {code:sql}
> select deptno from emp
> join dept using (deptno)
> join dept as d2 using (deptno)
> {code}
> {noformat}
> org.opentest4j.AssertionFailedError: Validator threw unexpected exception; 
> query [select deptno from emp
> join dept using (deptno)
> join dept as d2 using (deptno)]; exception [null]; class [class 
> java.lang.AssertionError]; pos [line -1 col -1 thru line -1 col -1]
>       at 
> app//org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:38)
>       at app//org.junit.jupiter.api.Assertions.fail(Assertions.java:138)
>       at app//org.apache.calcite.sql.test.SqlTests.checkEx(SqlTests.java:363)
> {noformat}
> the query passes in PostgreSQL, DuckDB



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to