Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6369

Expanding "star" gives ArrayIndexOutOfBoundsException with redundant columns and USING

    XMLWordPrintableJSON

Details

    Description

      The query

      select r_regionkey, * from region r0 join region r1 using (r_regionkey)
      

      produces

      java.lang.ArrayIndexOutOfBoundsException: Index 14 out of bounds for length 14
          at org.apache.calcite.runtime.PairLists$ArrayImmutablePairList.get (PairLists.java:573)
          at org.apache.calcite.runtime.PairLists$ArrayImmutablePairList.get (PairLists.java:550)
          at org.apache.calcite.sql.validate.SqlValidatorImpl$Permute.permute (SqlValidatorImpl.java:7443)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.expandStar (SqlValidatorImpl.java:697)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.expandSelectItem (SqlValidatorImpl.java:453)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelectList (SqlValidatorImpl.java:4658)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect (SqlValidatorImpl.java:3840)
          at org.apache.calcite.sql.validate.SelectNamespace.validateImpl (SelectNamespace.java:61)
          at org.apache.calcite.sql.validate.AbstractNamespace.validate (AbstractNamespace.java:88)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace (SqlValidatorImpl.java:1154)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery (SqlValidatorImpl.java:1125)
      

      Attachments

        Issue Links

          Activity

            People

              njordan Norman Jordan
              cbrisson Claude Brisson
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: