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

Evgeny Stanilovsky commented on IGNITE-15569:
---------------------------------------------

thanks ! looks good.

> Calcite. JOIN with USING fails.
> -------------------------------
>
>                 Key: IGNITE-15569
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15569
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Evgeny Stanilovsky
>            Assignee: Aleksey Plekhanov
>            Priority: Major
>              Labels: calcite, calcite2-required, calcite3-required, ignite-3
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {noformat}
> statement ok
> CREATE TABLE t1 (a INTEGER, b INTEGER)
> statement ok
> INSERT INTO t1 VALUES (1, 2)
> statement ok
> CREATE TABLE t2 (b INTEGER, c INTEGER)
> statement ok
> INSERT INTO t2 VALUES (2, 3)
> statement ok
> CREATE TABLE t3 (c INTEGER, d INTEGER)
> statement ok
> INSERT INTO t3 VALUES (3, 4)
> query IIII
> SELECT * FROM t1 JOIN t2 USING (b) JOIN t3 USING (c) ORDER BY 1, 2, 3, 4;
> ----
> 1     2       3       4
> {noformat}
> fails with
> {noformat}
> java.lang.ArrayIndexOutOfBoundsException: 7
>       at 
> com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:60)
>       at 
> org.apache.calcite.sql.validate.SqlValidatorImpl$Permute.permute(SqlValidatorImpl.java:7084)
>       at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.expandStar(SqlValidatorImpl.java:662)
>       at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.expandSelectItem(SqlValidatorImpl.java:424)
>       at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelectList(SqlValidatorImpl.java:4414)
>       at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3657)
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.IgniteSqlValidator.validateSelect(IgniteSqlValidator.java:182)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to