Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3995

Scalar replacement bug with Common Subexpression Elimination

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • None
    • 1.17.0
    • None
    • None

    Description

      The following query:

      select t1.full_name from cp.`employee.json` t1, cp.`department.json` t2 where t1.department_id = t2.department_id and t1.position_id = t2.department_id
      

      fails with the following:

      org.apache.drill.common.exceptions.UserRemoteException: SYSTEM ERROR: RuntimeException: Error at instruction 43: Expected an object reference, but found . setValue(II)V
      00000 R I I . . . . : : L0
      00001 R I I . . . . : : LINENUMBER 249 L0
      00002 R I I . . . . : : ICONST_0
      00003 R I I . . . . : I : ISTORE 3
      00004 R I I I . . . : : LCONST_0
      00005 R I I I . . . : J : LSTORE 4
      00006 R I I I J . . : : L1
      00007 R I I I J . . : : LINENUMBER 251 L1
      00008 R I I I J . . : : ALOAD 0
      00009 R I I I J . . : R : GETFIELD org/apache/drill/exec/test/generated/HashTableGen2$BatchHolder.vv20 : Lorg/apache/drill/exec/vector/NullableBigIntVector;
      00010 R I I I J . . : R : INVOKEVIRTUAL org/apache/drill/exec/vector/NullableBigIntVector.getAccessor ()Lorg/apache/drill/exec/vector/NullableBigIntVector$Accessor;
      00011 R I I I J . . : R : ILOAD 1
      00012 R I I I J . . : R I : INVOKEVIRTUAL org/apache/drill/exec/vector/NullableBigIntVector$Accessor.isSet (I)I
      00013 R I I I J . . : I : ISTORE 3
      00014 R I I I J . . : : L2
      00015 R I I I J . . : : LINENUMBER 252 L2
      00016 R I I I J . . : : ILOAD 3
      00017 R I I I J . . : I : ICONST_1
      00018 R I I I J . . : I I : IF_ICMPNE L3
      00019 R I I I J . . : : L4
      00020 ? : LINENUMBER 253 L4
      00021 ? : ALOAD 0
      00022 ? : GETFIELD org/apache/drill/exec/test/generated/HashTableGen2$BatchHolder.vv20 : Lorg/apache/drill/exec/vector/NullableBigIntVector;
      00023 ? : INVOKEVIRTUAL org/apache/drill/exec/vector/NullableBigIntVector.getAccessor ()Lorg/apache/drill/exec/vector/NullableBigIntVector$Accessor;
      00024 ? : ILOAD 1
      00025 ? : INVOKEVIRTUAL org/apache/drill/exec/vector/NullableBigIntVector$Accessor.get (I)J
      00026 ? : LSTORE 4
      00027 R I I I J . . : : L3
      00028 R I I I J . . : : LINENUMBER 256 L3
      00029 R I I I J . . : : ILOAD 3
      00030 R I I I J . . : I : ICONST_0
      00031 R I I I J . . : I I : IF_ICMPEQ L5
      00032 R I I I J . . : : L6
      00033 ? : LINENUMBER 257 L6
      00034 ? : ALOAD 0
      00035 ? : GETFIELD org/apache/drill/exec/test/generated/HashTableGen2$BatchHolder.vv24 : Lorg/apache/drill/exec/vector/NullableBigIntVector;
      00036 ? : INVOKEVIRTUAL org/apache/drill/exec/vector/NullableBigIntVector.getMutator ()Lorg/apache/drill/exec/vector/NullableBigIntVector$Mutator;
      00037 ? : ILOAD 2
      00038 ? : ILOAD 3
      00039 ? : LLOAD 4
      00040 ? : INVOKEVIRTUAL org/apache/drill/exec/vector/NullableBigIntVector$Mutator.set (IIJ)V
      00041 R I I I J . . : : L5
      00042 R I I I J . . : : LINENUMBER 259 L5
      00043 R I I I J . . : : ALOAD 6
      00044 ? : GETFIELD org/apache/drill/exec/expr/holders/NullableBigIntHolder.isSet : I
      00045 ? : ICONST_0
      00046 ? : IF_ICMPEQ L7
      00047 ? : L8
      00048 ? : LINENUMBER 260 L8
      00049 ? : ALOAD 0
      00050 ? : GETFIELD org/apache/drill/exec/test/generated/HashTableGen2$BatchHolder.vv27 : Lorg/apache/drill/exec/vector/NullableBigIntVector;
      00051 ? : INVOKEVIRTUAL org/apache/drill/exec/vector/NullableBigIntVector.getMutator ()Lorg/apache/drill/exec/vector/NullableBigIntVector$Mutator;
      00052 ? : ILOAD 2
      00053 ? : ALOAD 6
      00054 ? : GETFIELD org/apache/drill/exec/expr/holders/NullableBigIntHolder.isSet : I
      00055 ? : ALOAD 6
      00056 ? : GETFIELD org/apache/drill/exec/expr/holders/NullableBigIntHolder.value : J
      00057 ? : INVOKEVIRTUAL org/apache/drill/exec/vector/NullableBigIntVector$Mutator.set (IIJ)V
      00058 ? : L7
      00059 ? : LINENUMBER 245 L7
      00060 ? : RETURN
      00061 ? : L9

      when common subexpressions are eliminated (see DRILL-3912).

      Attachments

        Activity

          People

            Unassigned Unassigned
            sphillips Steven Phillips
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: