>From Vijay Sarathy <[email protected]>: Vijay Sarathy has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19350 )
Change subject: [ASTERIXDB-3553][COMP] Array Index out of bounds for UNNEST query ...................................................................... [ASTERIXDB-3553][COMP] Array Index out of bounds for UNNEST query Ext-ref: MB-64951 Change-Id: Ic786c0a339775aa35d54ab7b6c06f1a9efbec986 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19350 Reviewed-by: Vijay Sarathy <[email protected]> Reviewed-by: <[email protected]> Tested-by: Jenkins <[email protected]> --- M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/EnumerateJoinsRule.java 1 file changed, 40 insertions(+), 6 deletions(-) Approvals: [email protected]: Looks good to me, but someone else must approve Vijay Sarathy: Looks good to me, approved Jenkins: Verified diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/EnumerateJoinsRule.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/EnumerateJoinsRule.java index 8b05030..1dc37c4 100644 --- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/EnumerateJoinsRule.java +++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/EnumerateJoinsRule.java @@ -204,6 +204,14 @@ // without any hitch. Basically, we cannot go back now!! // now that we know it is safe to proceed with unnesting array optimization, we will remove // the unnestOps and related assign ops from the leafInputs and add them back later at the right places. + //select count (*) from KS1 x, x.uarr_i, x.zarr_i, KS2 y, y. earr_i where x.rand_n = y.rand_n; + //realInput 0 = true (KS1) + //realInput 1 = false + //realInput 2 = false + //realInput 3 = true (KS2) + //realInput 4 = false + //Note: The Unnesting code may move UNNEST Ops from the leafInputs higher up in the plan. + //The code is not designed to deal with UNNEST Ops that are not in the leafInputs. int i = -1; int j = -1; for (List<List<ILogicalOperator>> l : unnestOpsInfo) { @@ -353,7 +361,9 @@ buildNewTree(cheapestPlanNode); } context.computeAndSetTypeEnvironmentForOperator(root); - String finalPlan = new ALogicalPlanImpl(opRef).toString(); //useful when debugging + if (LOGGER.isTraceEnabled()) { + String finalPlan = new ALogicalPlanImpl(opRef).toString(); //useful when debugging + } return true; } @@ -451,7 +461,9 @@ ILogicalOperator parentOp = null; // The final left outerjoin operator is what we will attach the leafInput to for (List<ILogicalOperator> l2 : l1) { - String viewInPlan = new ALogicalPlanImpl(opRef).toString(); //useful when debugging + if (LOGGER.isTraceEnabled()) { + String viewInPlan = new ALogicalPlanImpl(opRef).toString(); //useful when debugging + } DataSourceScanOperator fakeDs = (DataSourceScanOperator) truncateInput(leafInput); fakeLeafInputsMap.put(fakeDs, true); LogicalVariable var1 = fakeDs.getVariables().get(0); @@ -460,13 +472,19 @@ ILogicalExpression expr = makeNewexpr(var1, var2); foj = new LeftOuterJoinOperator(new MutableObject<>(expr), new MutableObject<>(leftChild), q, ConstantExpression.MISSING.getValue()); - viewInPlan = new ALogicalPlanImpl(opRef).toString(); //useful when debugging + if (LOGGER.isTraceEnabled()) { + String viewInPlan = new ALogicalPlanImpl(opRef).toString(); //useful when debugging + } leftChild = foj; - viewInPlan = new ALogicalPlanImpl(opRef).toString(); //useful when debugging + if (LOGGER.isTraceEnabled()) { + String viewInPlan = new ALogicalPlanImpl(opRef).toString(); //useful when debugging + } } - Pair<ILogicalOperator, Integer> parent = parentsOfLeafInputs.get(i); + Pair<ILogicalOperator, Integer> parent = parentsOfLeafInputs.get(j); parent.first.getInputs().get(parent.second).setValue(foj); - String viewInPlan = new ALogicalPlanImpl(opRef).toString(); //useful when debugging + if (LOGGER.isTraceEnabled()) { + String viewInPlan = new ALogicalPlanImpl(opRef).toString(); //useful when debugging + } } } -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19350 To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: Ic786c0a339775aa35d54ab7b6c06f1a9efbec986 Gerrit-Change-Number: 19350 Gerrit-PatchSet: 3 Gerrit-Owner: [email protected] Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Vijay Sarathy <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-MessageType: merged
