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

Calcite. NATURAL JOIN fails.

    XMLWordPrintableJSON

Details

    Description

      statement ok
      CREATE TABLE t1 (a INTEGER, b INTEGER)
      
      statement ok
      INSERT INTO t1 VALUES (1, 2)
      
      statement ok
      CREATE TABLE t2 (a INTEGER, c INTEGER)
      
      statement ok
      INSERT INTO t2 VALUES (1, 3), (2, 4)
      
      query III
      SELECT * FROM t1 NATURAL JOIN t2
      ----
      1	2	3
      

      fails with

      java.lang.ArrayIndexOutOfBoundsException: 4
      
      	at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:60)
      	at org.apache.calcite.sql.validate.SqlValidatorImpl$Permute.permute(SqlValidatorImpl.java:7089)
      	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)
      
      /join/natural/natural_join.test[_ignored]
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zstan Evgeny Stanilovsky
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: