Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
Following are the steps to reproduce the issue
- Create two dataset collection1 and collection2
- Create the following index
CREATE INDEX idx1 ON collection2 (date: STRING, oid: STRING, sym: STRING, reg: BIGINT);
Execute the following query
with tmp1 AS ( SELECT S.sym FROM collection1 AS S WHERE S.date = NOW_LOCAL('1111-11-11')), tmp2 AS ( SELECT O.sym FROM collection2 AS O WHERE O.date = NOW_LOCAL('1111-11-11') ) SELECT sl1.sym FROM tmp1 AS sl1 UNION ALL SELECT sl2.sym FROM tmp2 as sl2;
Results in the following error
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?] at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?] at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[?:?] at java.util.Objects.checkIndex(Objects.java:361) ~[?:?] at java.util.ArrayList.get(ArrayList.java:427) ~[?:?] at org.apache.hyracks.algebricks.core.algebra.operators.logical.AggregateOperator.computeOutputTypeEnvironment(AggregateOperator.java:93) ~[algebricks-core-7.2.4-7070.jar:7.2.4-7070] at org.apache.hyracks.algebricks.core.rewriter.base.AlgebricksOptimizationContext.computeAndSetTypeEnvironmentForOperator(AlgebricksOptimizationContext.java:318) ~[algebricks-core-7.2.4-7070.jar:7.2.4-7070] at org.apache.hyracks.algebricks.core.algebra.util.OperatorPropertiesUtil.typeOpRec(OperatorPropertiesUtil.java:253) ~[algebricks-core-7.2.4-7070.jar:7.2.4-7070] at org.apache.hyracks.algebricks.core.algebra.util.OperatorPropertiesUtil.typeOpRec(OperatorPropertiesUtil.java:246) ~[algebricks-core-7.2.4-7070.jar:7.2.4-7070] at org.apache.hyracks.algebricks.core.algebra.util.OperatorPropertiesUtil.typeOpRec(OperatorPropertiesUtil.java:246) ~[algebricks-core-7.2.4-7070.jar:7.2.4-7070] at org.apache.hyracks.algebricks.core.algebra.util.OperatorPropertiesUtil.typeOpRec(OperatorPropertiesUtil.java:246) ~[algebricks-core-7.2.4-7070.jar:7.2.4-7070] at org.apache.hyracks.algebricks.core.algebra.util.OperatorPropertiesUtil.typeOpRec(OperatorPropertiesUtil.java:246) ~[algebricks-core-7.2.4-7070.jar:7.2.4-7070] at org.apache.hyracks.algebricks.core.algebra.util.OperatorPropertiesUtil.typeOpRec(OperatorPropertiesUtil.java:246) ~[algebricks-core-7.2.4-7070.jar:7.2.4-7070] at org.apache.hyracks.algebricks.core.algebra.util.OperatorPropertiesUtil.typeOpRec(OperatorPropertiesUtil.java:246) ~[algebricks-core-7.2.4-7070.jar:7.2.4-7070] at org.apache.asterix.optimizer.rules.am.IntroduceSelectAccessMethodRule.checkAndApplyTheSelectTransformation(IntroduceSelectAccessMethodRule.java:528) ~[asterix-algebra-7.2.4-7070.jar:7.2.4-7070] at org.apache.asterix.optimizer.rules.am.IntroduceSelectAccessMethodRule.checkAndApplyTheSelectTransformation(IntroduceSelectAccessMethodRule.java:405) ~[asterix-algebra-7.2.4-7070.jar:7.2.4-7070]