Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15569

Calcite. JOIN with USING fails.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • sql

    Description

      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
      

      fails with

      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)
      

      Attachments

        Issue Links

          Activity

            People

              alex_pl Aleksey Plekhanov
              zstan Evgeny Stanilovsky
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h