Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-16828

With CBO enabled, Query on partitioned views throws IndexOutOfBoundException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.0, 2.1.1, 2.2.0
    • 3.0.0
    • CBO
    • None

    Description

      Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.sql2rel.RelFieldTrimmer$TrimResult org.apache.calcite.sql2rel.RelFieldTrimmer.trimFields(org.apache.calcite.rel.core.Filter,org.apache.calcite.util.ImmutableBitSet,java.util.Set)'
      at org.apache.calcite.util.Util.newInternal(Util.java:789)
      at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534)
      at org.apache.calcite.sql2rel.RelFieldTrimmer.dispatchTrimFields(RelFieldTrimmer.java:270)
      at org.apache.calcite.sql2rel.RelFieldTrimmer.trimChild(RelFieldTrimmer.java:213)
      at org.apache.calcite.sql2rel.RelFieldTrimmer.trimFields(RelFieldTrimmer.java:374)
      at org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveRelFieldTrimmer.trimFields(HiveRelFieldTrimmer.java:394)
      ... 98 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531)
      ... 102 more
      Caused by: java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.sql2rel.RelFieldTrimmer$TrimResult org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveRelFieldTrimmer.trimFields(org.apache.calcite.rel.core.Project,org.apache.calcite.util.ImmutableBitSet,java.util.Set)'
      at org.apache.calcite.util.Util.newInternal(Util.java:789)
      at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:534)
      at org.apache.calcite.sql2rel.RelFieldTrimmer.dispatchTrimFields(RelFieldTrimmer.java:270)
      at org.apache.calcite.sql2rel.RelFieldTrimmer.trimChild(RelFieldTrimmer.java:213)
      at org.apache.calcite.sql2rel.RelFieldTrimmer.trimFields(RelFieldTrimmer.java:466)
      ... 107 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531)
      ... 110 more
      Caused by: java.lang.IndexOutOfBoundsException: Index: 94, Size: 94
      at java.util.ArrayList.rangeCheck(ArrayList.java:653)
      at java.util.ArrayList.get(ArrayList.java:429)
      at org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveRelFieldTrimmer.trimFields(HiveRelFieldTrimmer.java:390)
      

      Reproducible case:
      1) set "hive.security.authorization.enabled" to "true" in "hive-site.xml".
      2)

      CREATE TABLE table1 (id int) PARTITIONED BY (year int)
      
      -- create partitioned view
      CREATE VIEW view1 partitioned on (year) as select id, year from table1;
      
      set hive.cbo.enable=true;
      select year from view1;
      

      Attachments

        1. HIVE-16828.patch
          1 kB
          Adesh Kumar Rao
        2. HIVE-16828.2.patch
          5 kB
          Vineet Garg
        3. HIVE-16828.3.patch
          4 kB
          Vineet Garg

        Activity

          People

            vgarg Vineet Garg
            adeshrao Adesh Kumar Rao
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: