From 7021b3f42cc15e88f08e303db6fabe0f0dc31a19 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 8 Nov 2024 17:33:31 +0000 Subject: [PATCH 01/99] working? --- .../calcite/planner/CalciteRulesManager.java | 3 +- .../calcite/planner/DruidRelFieldTrimmer.java | 297 ++++++++++++++++++ 2 files changed, 298 insertions(+), 2 deletions(-) create mode 100644 sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index d6dd1310e6c5..6502ed11271e 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -45,7 +45,6 @@ import org.apache.calcite.sql.SqlExplainFormat; import org.apache.calcite.sql.SqlExplainLevel; import org.apache.calcite.sql2rel.RelDecorrelator; -import org.apache.calcite.sql2rel.RelFieldTrimmer; import org.apache.calcite.tools.Program; import org.apache.calcite.tools.Programs; import org.apache.calcite.tools.RelBuilder; @@ -539,7 +538,7 @@ public RelNode run( { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); final RelNode decorrelatedRel = RelDecorrelator.decorrelateQuery(rel, relBuilder); - return new RelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); + return new DruidRelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); } } } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java new file mode 100644 index 000000000000..190e4048aa81 --- /dev/null +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -0,0 +1,297 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.sql.calcite.planner; + +import org.apache.calcite.rel.RelHomogeneousShuttle; +import org.apache.calcite.rel.RelNode; +import org.apache.calcite.rel.core.CorrelationId; +import org.apache.calcite.rel.logical.LogicalCorrelate; +import org.apache.calcite.rel.type.RelDataType; +import org.apache.calcite.rel.type.RelDataTypeField; +import org.apache.calcite.rex.RexBuilder; +import org.apache.calcite.rex.RexCorrelVariable; +import org.apache.calcite.rex.RexFieldAccess; +import org.apache.calcite.rex.RexInputRef; +import org.apache.calcite.rex.RexNode; +import org.apache.calcite.rex.RexShuttle; +import org.apache.calcite.rex.RexVisitor; +import org.apache.calcite.sql.validate.SqlValidator; +import org.apache.calcite.sql2rel.RelFieldTrimmer; +import org.apache.calcite.tools.RelBuilder; +import org.apache.calcite.util.ImmutableBitSet; +import org.apache.calcite.util.mapping.IntPair; +import org.apache.calcite.util.mapping.Mapping; +import org.apache.calcite.util.mapping.MappingType; +import org.apache.calcite.util.mapping.Mappings; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +public class DruidRelFieldTrimmer extends RelFieldTrimmer +{ + private RelBuilder relBuilder; + + public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuilder) + { + super(validator, relBuilder); + this.relBuilder = relBuilder; + } + +public TrimResult trimFields(LogicalCorrelate correlate, + ImmutableBitSet fieldsUsed, + Set extraFields) + { + +// final RelDataType rowType = correlate.getRowType(); +// final int fieldCount = rowType.getFieldCount(); +// final RelNode left = correlate.getLeft(); +// final RelNode right = correlate.getRight(); +// final RelDataType rightRowType = right.getRowType(); +// final int rightFieldCount = rightRowType.getFieldCount(); + if (!extraFields.isEmpty()) { + // bail out with generic trim + return trimFields((RelNode) correlate, fieldsUsed, extraFields); + } + + fieldsUsed = fieldsUsed.union(correlate.getRequiredColumns()); + + List newInputs = new ArrayList<>(); + List inputMappings = new ArrayList<>(); + @Deprecated + int changeCount=0; + int offset=0; + @Deprecated + int newFieldCount = 0; + for(RelNode input : correlate.getInputs()) + { + final RelDataType inputRowType = input.getRowType(); + final int inputFieldCount = inputRowType.getFieldCount(); + + ImmutableBitSet currentInputFieldsUsed = fieldsUsed + .intersect(ImmutableBitSet.range(offset, offset + inputFieldCount)) + .shift(-offset); + + + TrimResult trimResult; + try { + trimResult = dispatchTrimFields(input, currentInputFieldsUsed, extraFields); + } + catch (RuntimeException e) { + throw e; + } + + newInputs.add(trimResult.left); + if (trimResult.left != input) { + changeCount++; + } + + final Mapping inputMapping = trimResult.right; + inputMappings.add(inputMapping); + + offset += inputFieldCount; + newFieldCount += inputMapping.getTargetCount() ; + } + + + if(changeCount<-1) { + return trimFields((RelNode) correlate, fieldsUsed, extraFields); + } + + Mapping mapping = makeMapping(inputMappings); + if(true) { + final LogicalCorrelate newCorrelate = + correlate.copy( + correlate.getTraitSet(), + newInputs.get(0), + newInputs.get(1).accept( + new RelVistatorRelShuttle( + new CorrelateExprMapping(correlate.getCorrelationId(), newInputs.get(0).getRowType(), mapping) + ) + ), + correlate.getCorrelationId(), + correlate.getRequiredColumns().permute(mapping), + correlate.getJoinType() + ); + + return result(newCorrelate, mapping); + +// return result(correlate, mapping); + } + +// correlate.cop + + RelNode left = null; + ImmutableBitSet newFieldsUsed = null; + TrimResult leftTrimResult = + trimChild(correlate, left, newFieldsUsed, extraFields); + RelNode newLeft = leftTrimResult.left; + final Mapping leftMapping = leftTrimResult.right; + + RelNode right = null; + ImmutableBitSet rightFieldsUsed = null; + Set rightExtraFields = null; + // Create right input with trimmed columns. + TrimResult rightTrimResult = + trimChild(correlate, right, rightFieldsUsed, rightExtraFields); + RelNode newRight = rightTrimResult.left; + final Mapping rightMapping = rightTrimResult.right; + + int fieldCount = 0; + // If the inputs are unchanged, and we need to project all columns, + // there's nothing we can do. + if (newLeft == left + && newRight == right + && fieldsUsed.cardinality() == fieldCount) { + return result(correlate, Mappings.createIdentity(fieldCount)); + } + + // Build new correlate and populate the mapping. + final RexVisitor shuttle = null; + +// new RexPermuteInputsShuttle(leftMapping, newLeft, rightMapping, newRight); +// RexNode newConditionExpr = conditionExpr.accept(shuttle); + + // Build new correlate with trimmed inputs and condition. + final LogicalCorrelate newCorrelate = + correlate.copy(correlate.getTraitSet(), + newLeft, + newRight, correlate.getCorrelationId(), + correlate.getRequiredColumns(), correlate.getJoinType()); + + return result(newCorrelate, mapping); + } + + /** + * Concatenates multiple mapping. + * + * [ 1:0, 2:1] // sourceCount:100 + * [ 1:0, 2:1] // sourceCount:100 + * output: + * [ 1:0, 2:1, 101:2, 102:3 ] ; sourceCount:200 + */ + private Mapping makeMapping(List inputMappings) + { + int fieldCount = 0; + int newFieldCount = 0; + for (Mapping mapping : inputMappings) { + fieldCount += mapping.getSourceCount(); + newFieldCount += mapping.getTargetCount(); + } + + Mapping mapping = Mappings.create( + MappingType.INVERSE_SURJECTION, + fieldCount, + newFieldCount + ); + int offset = 0; + int newOffset = 0; + for (int i = 0; i < inputMappings.size(); i++) { + Mapping inputMapping = inputMappings.get(i); + for (IntPair pair : inputMapping) { + mapping.set(pair.source + offset, pair.target + newOffset); + } + offset += inputMapping.getSourceCount(); + newOffset += inputMapping.getTargetCount(); + } + return mapping; + } + + class CorrelateExprMapping extends RexShuttle { + private final CorrelationId correlationId; + private Mapping mapping; + private RelDataType newCorrelRowType; + + public CorrelateExprMapping(final CorrelationId correlationId, RelDataType newCorrelRowType, Mapping mapping) + { + this.correlationId = correlationId; + this.newCorrelRowType = newCorrelRowType; + this.mapping = mapping; + } + + @Override + public RexNode visitFieldAccess(final RexFieldAccess fieldAccess) + { + RexNode referenceExpr1 = fieldAccess.getReferenceExpr(); + if (referenceExpr1 instanceof RexCorrelVariable) { + RexCorrelVariable referenceExpr = (RexCorrelVariable) referenceExpr1; + final RexCorrelVariable encounteredCorrelationId = referenceExpr; + if (encounteredCorrelationId.id.equals(correlationId)) { + + RexBuilder rb = relBuilder.getRexBuilder(); + int sourceIndex=fieldAccess.getField().getIndex(); + ; + RexFieldAccess a =(RexFieldAccess) rb.makeFieldAccess(map(referenceExpr), mapping.getTarget(sourceIndex)); + +if(true) { + return a; +} else { + return new RexInputRef(fieldAccess.getField().getIndex(), fieldAccess.getType()); +} + } + } + return super.visitFieldAccess(fieldAccess); + } + + private RexNode map(RexCorrelVariable referenceExpr) + { + RexBuilder rb = relBuilder.getRexBuilder(); +// RelDataType type = referenceExpr.getType(); +// List inputFields = type.getFieldList(); +// List newFields = new ArrayList<>(); +// for(int i=0;i Date: Fri, 8 Nov 2024 17:53:59 +0000 Subject: [PATCH 02/99] x --- .../druid/sql/calcite/planner/CalciteRulesManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 6502ed11271e..aa88870f0b8f 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -45,6 +45,7 @@ import org.apache.calcite.sql.SqlExplainFormat; import org.apache.calcite.sql.SqlExplainLevel; import org.apache.calcite.sql2rel.RelDecorrelator; +import org.apache.calcite.sql2rel.RelFieldTrimmer; import org.apache.calcite.tools.Program; import org.apache.calcite.tools.Programs; import org.apache.calcite.tools.RelBuilder; @@ -538,7 +539,11 @@ public RelNode run( { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); final RelNode decorrelatedRel = RelDecorrelator.decorrelateQuery(rel, relBuilder); - return new DruidRelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); + if(true) { + return new DruidRelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); + } else { + return new RelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); + } } } } From 00837c56ed3024535f9e253c4400bd861e8f5a48 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Sat, 9 Nov 2024 16:54:13 +0000 Subject: [PATCH 03/99] clenaup --- .../calcite/planner/DruidRelFieldTrimmer.java | 143 ++++-------------- 1 file changed, 32 insertions(+), 111 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 190e4048aa81..7c031f3936da 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -28,10 +28,8 @@ import org.apache.calcite.rex.RexBuilder; import org.apache.calcite.rex.RexCorrelVariable; import org.apache.calcite.rex.RexFieldAccess; -import org.apache.calcite.rex.RexInputRef; import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexShuttle; -import org.apache.calcite.rex.RexVisitor; import org.apache.calcite.sql.validate.SqlValidator; import org.apache.calcite.sql2rel.RelFieldTrimmer; import org.apache.calcite.tools.RelBuilder; @@ -56,17 +54,17 @@ public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuil this.relBuilder = relBuilder; } -public TrimResult trimFields(LogicalCorrelate correlate, + public TrimResult trimFields(LogicalCorrelate correlate, ImmutableBitSet fieldsUsed, Set extraFields) { -// final RelDataType rowType = correlate.getRowType(); -// final int fieldCount = rowType.getFieldCount(); -// final RelNode left = correlate.getLeft(); -// final RelNode right = correlate.getRight(); -// final RelDataType rightRowType = right.getRowType(); -// final int rightFieldCount = rightRowType.getFieldCount(); + // final RelDataType rowType = correlate.getRowType(); + // final int fieldCount = rowType.getFieldCount(); + // final RelNode left = correlate.getLeft(); + // final RelNode right = correlate.getRight(); + // final RelDataType rightRowType = right.getRowType(); + // final int rightFieldCount = rightRowType.getFieldCount(); if (!extraFields.isEmpty()) { // bail out with generic trim return trimFields((RelNode) correlate, fieldsUsed, extraFields); @@ -77,12 +75,9 @@ public TrimResult trimFields(LogicalCorrelate correlate, List newInputs = new ArrayList<>(); List inputMappings = new ArrayList<>(); @Deprecated - int changeCount=0; - int offset=0; - @Deprecated - int newFieldCount = 0; - for(RelNode input : correlate.getInputs()) - { + int changeCount = 0; + int offset = 0; + for (RelNode input : correlate.getInputs()) { final RelDataType inputRowType = input.getRowType(); final int inputFieldCount = inputRowType.getFieldCount(); @@ -90,7 +85,6 @@ public TrimResult trimFields(LogicalCorrelate correlate, .intersect(ImmutableBitSet.range(offset, offset + inputFieldCount)) .shift(-offset); - TrimResult trimResult; try { trimResult = dispatchTrimFields(input, currentInputFieldsUsed, extraFields); @@ -108,74 +102,25 @@ public TrimResult trimFields(LogicalCorrelate correlate, inputMappings.add(inputMapping); offset += inputFieldCount; - newFieldCount += inputMapping.getTargetCount() ; } - - if(changeCount<-1) { - return trimFields((RelNode) correlate, fieldsUsed, extraFields); + if (changeCount < -1) { + return result(correlate, Mappings.createIdentity(correlate.getRowType().getFieldCount())); } Mapping mapping = makeMapping(inputMappings); - if(true) { - final LogicalCorrelate newCorrelate = - correlate.copy( - correlate.getTraitSet(), - newInputs.get(0), - newInputs.get(1).accept( - new RelVistatorRelShuttle( - new CorrelateExprMapping(correlate.getCorrelationId(), newInputs.get(0).getRowType(), mapping) - ) - ), - correlate.getCorrelationId(), - correlate.getRequiredColumns().permute(mapping), - correlate.getJoinType() - ); - - return result(newCorrelate, mapping); - -// return result(correlate, mapping); - } - -// correlate.cop - - RelNode left = null; - ImmutableBitSet newFieldsUsed = null; - TrimResult leftTrimResult = - trimChild(correlate, left, newFieldsUsed, extraFields); - RelNode newLeft = leftTrimResult.left; - final Mapping leftMapping = leftTrimResult.right; - - RelNode right = null; - ImmutableBitSet rightFieldsUsed = null; - Set rightExtraFields = null; - // Create right input with trimmed columns. - TrimResult rightTrimResult = - trimChild(correlate, right, rightFieldsUsed, rightExtraFields); - RelNode newRight = rightTrimResult.left; - final Mapping rightMapping = rightTrimResult.right; - - int fieldCount = 0; - // If the inputs are unchanged, and we need to project all columns, - // there's nothing we can do. - if (newLeft == left - && newRight == right - && fieldsUsed.cardinality() == fieldCount) { - return result(correlate, Mappings.createIdentity(fieldCount)); - } - - // Build new correlate and populate the mapping. - final RexVisitor shuttle = null; - -// new RexPermuteInputsShuttle(leftMapping, newLeft, rightMapping, newRight); -// RexNode newConditionExpr = conditionExpr.accept(shuttle); - - // Build new correlate with trimmed inputs and condition. - final LogicalCorrelate newCorrelate = - correlate.copy(correlate.getTraitSet(), - newLeft, - newRight, correlate.getCorrelationId(), - correlate.getRequiredColumns(), correlate.getJoinType()); + final LogicalCorrelate newCorrelate = correlate.copy( + correlate.getTraitSet(), + newInputs.get(0), + newInputs.get(1).accept( + new RelVistatorRelShuttle( + new CorrelateExprMapping(correlate.getCorrelationId(), newInputs.get(0).getRowType(), mapping) + ) + ), + correlate.getCorrelationId(), + correlate.getRequiredColumns().permute(mapping), + correlate.getJoinType() + ); return result(newCorrelate, mapping); } @@ -183,10 +128,8 @@ public TrimResult trimFields(LogicalCorrelate correlate, /** * Concatenates multiple mapping. * - * [ 1:0, 2:1] // sourceCount:100 - * [ 1:0, 2:1] // sourceCount:100 - * output: - * [ 1:0, 2:1, 101:2, 102:3 ] ; sourceCount:200 + * [ 1:0, 2:1] // sourceCount:100 [ 1:0, 2:1] // sourceCount:100 output: [ + * 1:0, 2:1, 101:2, 102:3 ] ; sourceCount:200 */ private Mapping makeMapping(List inputMappings) { @@ -215,7 +158,8 @@ private Mapping makeMapping(List inputMappings) return mapping; } - class CorrelateExprMapping extends RexShuttle { + class CorrelateExprMapping extends RexShuttle + { private final CorrelationId correlationId; private Mapping mapping; private RelDataType newCorrelRowType; @@ -237,15 +181,11 @@ public RexNode visitFieldAccess(final RexFieldAccess fieldAccess) if (encounteredCorrelationId.id.equals(correlationId)) { RexBuilder rb = relBuilder.getRexBuilder(); - int sourceIndex=fieldAccess.getField().getIndex(); + int sourceIndex = fieldAccess.getField().getIndex(); ; - RexFieldAccess a =(RexFieldAccess) rb.makeFieldAccess(map(referenceExpr), mapping.getTarget(sourceIndex)); + RexFieldAccess a = (RexFieldAccess) rb.makeFieldAccess(map(referenceExpr), mapping.getTarget(sourceIndex)); -if(true) { - return a; -} else { - return new RexInputRef(fieldAccess.getField().getIndex(), fieldAccess.getType()); -} + return a; } } return super.visitFieldAccess(fieldAccess); @@ -254,26 +194,7 @@ public RexNode visitFieldAccess(final RexFieldAccess fieldAccess) private RexNode map(RexCorrelVariable referenceExpr) { RexBuilder rb = relBuilder.getRexBuilder(); -// RelDataType type = referenceExpr.getType(); -// List inputFields = type.getFieldList(); -// List newFields = new ArrayList<>(); -// for(int i=0;i Date: Mon, 11 Nov 2024 10:28:11 +0000 Subject: [PATCH 04/99] some updates --- .../rule/logical/UnnestInputCleanupRule.java | 62 +++++++++++++------ 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index baae4c4c9f79..38b1506736d5 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -25,9 +25,11 @@ import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.Project; import org.apache.calcite.rel.rules.SubstitutionRule; +import org.apache.calcite.rex.RexBuilder; import org.apache.calcite.rex.RexInputRef; import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexShuttle; +import org.apache.calcite.tools.RelBuilder; import org.apache.calcite.util.ImmutableBitSet; import org.apache.druid.error.DruidException; import java.util.ArrayList; @@ -56,7 +58,7 @@ public UnnestInputCleanupRule() public void onMatch(RelOptRuleCall call) { LogicalUnnest unnest = call.rel(0); - Project project = call.rel(1); + Project oldProject = call.rel(1); ImmutableBitSet input = InputFinder.analyze(unnest.unnestExpr).build(); if (input.isEmpty()) { @@ -71,34 +73,58 @@ public void onMatch(RelOptRuleCall call) return; } - int inputIndex = input.nextSetBit(0); + RelBuilder builder = call.builder(); + RexBuilder rexBuilder = builder.getRexBuilder(); - List projects = new ArrayList<>(project.getProjects()); - RexNode unnestInput = projects.get(inputIndex); + int inputIndex = input.nextSetBit(0); + List newProjects = new ArrayList<>(oldProject.getProjects()); + RexNode unnestInput = newProjects.get(inputIndex); - projects.set( - inputIndex, - call.builder().getRexBuilder().makeInputRef(project.getInput(), 0) - ); + newProjects.set(inputIndex, null); - RexNode newUnnestExpr = unnestInput.accept(new ExpressionPullerRexShuttle(projects, inputIndex)); + RexNode newUnnestExpr = unnestInput.accept(new ExpressionPullerRexShuttle(newProjects, inputIndex)); - if (projects.size() != project.getProjects().size()) { - // lets leave this for later - return; + if(newProjects.get(inputIndex) == null ) { + newProjects.set( + inputIndex, + rexBuilder.makeInputRef(oldProject.getInput(), 0) + ); } - - RelNode newInputRel = call.builder() - .push(project.getInput()) - .project(projects) + RelNode newInputRel = builder + .push(oldProject.getInput()) + .project(newProjects) .build(); +// new RelRecordType( +// +// ); + RelNode newUnnest = new LogicalUnnest( - unnest.getCluster(), unnest.getTraitSet(), newInputRel, newUnnestExpr, - unnest.getRowType(), unnest.filter + unnest.getCluster(), + unnest.getTraitSet(), + newInputRel, + newUnnestExpr, + unnest.getRowType(), + unnest.filter ); + + + builder.push(newUnnest); + // Erase any extra fields created during the above transformation to be seen outside + // this could happen in case the pulled out expression referenced + // not-anymore referenced input columns beneath oldProject + List projectFields = new ArrayList<>(builder.fields()); + int hideCount = newProjects.size() - oldProject.getProjects().size(); + if(hideCount>0) { + return; + } + for (int i = 0; i < hideCount; i++) { + projectFields.remove(unnest.getRowType().getFieldCount()-2); + } + builder.project(projectFields); + call.transformTo(newUnnest); call.getPlanner().prune(unnest); } From 2ceefdc0792a3b3aae913b8257457fb5420871ab Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Mon, 11 Nov 2024 10:49:25 +0000 Subject: [PATCH 05/99] try-unnestfiled-instead-rowtype (cherry picked from commit c4eb2cf1b82c7a332d57701e430ac582a986593f) --- .../sql/calcite/rule/logical/DruidUnnest.java | 7 ++++--- .../calcite/rule/logical/DruidUnnestRule.java | 3 ++- .../sql/calcite/rule/logical/LogicalUnnest.java | 8 ++++---- .../calcite/rule/logical/LogicalUnnestRule.java | 5 ++++- .../druid/sql/calcite/rule/logical/Unnest.java | 17 +++++++++++++++-- .../rule/logical/UnnestInputCleanupRule.java | 3 +-- 6 files changed, 30 insertions(+), 13 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java index 67170ffcd61e..f13ffa7d43ed 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java @@ -23,6 +23,7 @@ import org.apache.calcite.plan.RelTraitSet; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.type.RelDataType; +import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.rex.RexNode; import org.apache.druid.query.DataSource; import org.apache.druid.query.UnnestDataSource; @@ -43,15 +44,15 @@ public class DruidUnnest extends Unnest implements DruidLogicalNode, SourceDescProducer { protected DruidUnnest(RelOptCluster cluster, RelTraitSet traits, RelNode input, RexNode unnestExpr, - RelDataType rowType, RexNode condition) + RelDataTypeField unnestFieldType, RexNode condition) { - super(cluster, traits, input, unnestExpr, rowType, condition); + super(cluster, traits, input, unnestExpr, unnestFieldType, condition); } @Override protected RelNode copy(RelTraitSet traitSet, RelNode input) { - return new DruidUnnest(getCluster(), traitSet, input, unnestExpr, rowType, filter); + return new DruidUnnest(getCluster(), traitSet, input, unnestExpr, unnestFieldType, filter); } @Override diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnestRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnestRule.java index 257bb7ca38f5..570da98c2045 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnestRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnestRule.java @@ -46,6 +46,7 @@ public RelNode convert(RelNode rel) { LogicalUnnest unnest = (LogicalUnnest) rel; RelTraitSet newTrait = unnest.getTraitSet().replace(DruidLogicalConvention.instance()); + return new DruidUnnest( rel.getCluster(), newTrait, @@ -54,7 +55,7 @@ public RelNode convert(RelNode rel) DruidLogicalConvention.instance() ), unnest.getUnnestExpr(), - unnest.getRowType(), + unnest.unnestFieldType, unnest.filter ); } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnest.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnest.java index e23d4c6cd3ba..2768b1902a1e 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnest.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnest.java @@ -22,20 +22,20 @@ import org.apache.calcite.plan.RelOptCluster; import org.apache.calcite.plan.RelTraitSet; import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.type.RelDataType; +import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.rex.RexNode; public class LogicalUnnest extends Unnest { protected LogicalUnnest(RelOptCluster cluster, RelTraitSet traits, RelNode input, RexNode unnestExpr, - RelDataType rowType, RexNode condition) + RelDataTypeField unnestFieldType, RexNode condition) { - super(cluster, traits, input, unnestExpr, rowType, condition); + super(cluster, traits, input, unnestExpr, unnestFieldType, condition); } @Override protected RelNode copy(RelTraitSet traitSet, RelNode input) { - return new LogicalUnnest(getCluster(), traitSet, input, unnestExpr, rowType, filter); + return new LogicalUnnest(getCluster(), traitSet, input, unnestExpr, unnestFieldType, filter); } } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnestRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnestRule.java index 662cf76f5ac0..8771070b4fd8 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnestRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnestRule.java @@ -30,6 +30,7 @@ import org.apache.calcite.rel.logical.LogicalCorrelate; import org.apache.calcite.rel.logical.LogicalValues; import org.apache.calcite.rel.rules.SubstitutionRule; +import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.rex.RexNode; import org.apache.calcite.tools.RelBuilder; import org.apache.druid.error.DruidException; @@ -84,6 +85,8 @@ public void onMatch(RelOptRuleCall call) unnestConfig.expr = new DruidCorrelateUnnestRel.CorrelatedFieldAccessToInputRef(cor.getCorrelationId()) .apply(unnestConfig.expr); + RelDataTypeField unnestFieldType = Iterables.getLast(cor.getRowType().getFieldList()); + RelBuilder builder = call.builder(); builder.push(cor.getLeft()); RelNode newNode = builder.push( @@ -92,7 +95,7 @@ public void onMatch(RelOptRuleCall call) cor.getTraitSet(), builder.build(), unnestConfig.expr, - cor.getRowType(), + unnestFieldType, unnestConfig.condition ) ).build(); diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java index 58680b053e83..69c4a80a65ae 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java @@ -25,22 +25,35 @@ import org.apache.calcite.rel.RelWriter; import org.apache.calcite.rel.SingleRel; import org.apache.calcite.rel.type.RelDataType; +import org.apache.calcite.rel.type.RelDataTypeField; +import org.apache.calcite.rel.type.RelRecordType; import org.apache.calcite.rex.RexNode; +import java.util.ArrayList; import java.util.List; public abstract class Unnest extends SingleRel { protected final RexNode unnestExpr; protected final RexNode filter; + protected final RelDataTypeField unnestFieldType; protected Unnest(RelOptCluster cluster, RelTraitSet traits, RelNode input, RexNode unnestExpr, - RelDataType rowType, RexNode condition) + RelDataTypeField unnestFieldType, RexNode condition) { super(cluster, traits, input); this.unnestExpr = unnestExpr; - this.rowType = rowType; this.filter = condition; + this.unnestFieldType = unnestFieldType; + } + + @Override + protected RelDataType deriveRowType() + { + List fields =new ArrayList<>(); + fields.addAll(input.getRowType().getFieldList()); + fields.add(unnestFieldType); + return new RelRecordType(fields); } public final RexNode getUnnestExpr() diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index 38b1506736d5..3469cc8438be 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -106,11 +106,10 @@ public void onMatch(RelOptRuleCall call) unnest.getTraitSet(), newInputRel, newUnnestExpr, - unnest.getRowType(), + unnest.unnestFieldType, unnest.filter ); - builder.push(newUnnest); // Erase any extra fields created during the above transformation to be seen outside // this could happen in case the pulled out expression referenced From 4e0a37a59bb048c22c601d505a436211b1dc10bd Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Mon, 11 Nov 2024 12:39:30 +0000 Subject: [PATCH 06/99] more wood --- .../calcite/planner/CalciteRulesManager.java | 18 +++++++++++++- .../calcite/planner/DruidRelFieldTrimmer.java | 7 ++++++ .../rule/logical/UnnestInputCleanupRule.java | 24 +++++++++++++++++-- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index aa88870f0b8f..83993338a423 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -284,7 +284,10 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); builder.addRuleInstance(new LogicalUnnestRule()); builder.addRuleInstance(new UnnestInputCleanupRule()); - return Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE); + return Programs.sequence( + Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), + new DruidTrimFieldsProgram() + ); } /** @@ -546,4 +549,17 @@ public RelNode run( } } } + + /** Program that trims fields. */ + private static class DruidTrimFieldsProgram implements Program { + @Override public RelNode run(RelOptPlanner planner, RelNode rel, + RelTraitSet requiredOutputTraits, + List materializations, + List lattices) { + final RelBuilder relBuilder = + RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); + return new DruidRelFieldTrimmer(null, relBuilder).trim(rel); + } + } + } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 7c031f3936da..87537fca0b36 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -54,6 +54,13 @@ public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuil this.relBuilder = relBuilder; } + @Override + protected TrimResult dummyProject(int fieldCount, RelNode input) + { + + return result(input, Mappings.createIdentity(input.getRowType().getFieldCount())); + } + public TrimResult trimFields(LogicalCorrelate correlate, ImmutableBitSet fieldsUsed, Set extraFields) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index 3469cc8438be..d2259d5b9ef9 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -25,14 +25,17 @@ import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.Project; import org.apache.calcite.rel.rules.SubstitutionRule; +import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rex.RexBuilder; import org.apache.calcite.rex.RexInputRef; import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexShuttle; +import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.tools.RelBuilder; import org.apache.calcite.util.ImmutableBitSet; import org.apache.druid.error.DruidException; import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** @@ -84,6 +87,11 @@ public void onMatch(RelOptRuleCall call) RexNode newUnnestExpr = unnestInput.accept(new ExpressionPullerRexShuttle(newProjects, inputIndex)); + if(newUnnestExpr instanceof RexInputRef) { + // this won't make it simpler + return; + } + if(newProjects.get(inputIndex) == null ) { newProjects.set( inputIndex, @@ -117,14 +125,26 @@ public void onMatch(RelOptRuleCall call) List projectFields = new ArrayList<>(builder.fields()); int hideCount = newProjects.size() - oldProject.getProjects().size(); if(hideCount>0) { - return; +// return; } for (int i = 0; i < hideCount; i++) { projectFields.remove(unnest.getRowType().getFieldCount()-2); } + RelDataType type = oldProject.getProjects().get(inputIndex).getType(); + RexNode rn; + if(type.isNullable()) { + rn = rexBuilder.makeNullLiteral(type); + } else { + rn= rexBuilder.makeCall(type, SqlStdOperatorTable.CURRENT_VALUE, Collections.emptyList()); + } + + projectFields.set( + inputIndex, + rn + ); builder.project(projectFields); - call.transformTo(newUnnest); + call.transformTo(builder.build()); call.getPlanner().prune(unnest); } From e7061ad04afce5c0aa66dc4cfb2234192dca1243 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Mon, 11 Nov 2024 13:10:52 +0000 Subject: [PATCH 07/99] more wood --- .../sql/calcite/rule/logical/DruidUnnest.java | 2 +- .../rule/logical/UnnestInputCleanupRule.java | 7 +++--- .../sql/calcite/CalciteArraysQueryTest.java | 22 +++++++++---------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java index f13ffa7d43ed..e5c6b40ed999 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java @@ -124,6 +124,6 @@ private RowSignature computeRowOutputSignature(SourceDesc inputDesc) private RelDataType getUnnestedType() { - return rowType.getFieldList().get(rowType.getFieldCount() - 1).getType(); + return unnestFieldType.getType(); } } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index d2259d5b9ef9..8ab3289883bf 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -30,12 +30,10 @@ import org.apache.calcite.rex.RexInputRef; import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexShuttle; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.tools.RelBuilder; import org.apache.calcite.util.ImmutableBitSet; import org.apache.druid.error.DruidException; import java.util.ArrayList; -import java.util.Collections; import java.util.List; /** @@ -135,7 +133,10 @@ public void onMatch(RelOptRuleCall call) if(type.isNullable()) { rn = rexBuilder.makeNullLiteral(type); } else { - rn= rexBuilder.makeCall(type, SqlStdOperatorTable.CURRENT_VALUE, Collections.emptyList()); + // bail out + return; +// reutrn; +// rn= rexBuilder.makeCall(type, SqlStdOperatorTable.CURRENT_VALUE, Collections.emptyList()); } projectFields.set( diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index f2ef6941fc35..395e1559f71f 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4559,7 +4559,7 @@ public void testUnnestTwiceWithFiltersAndExpressions() } - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) +// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestThriceWithFiltersOnDimAndUnnestCol() { @@ -4645,7 +4645,7 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestCol() ); } - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) +// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumns() { @@ -5257,7 +5257,7 @@ public void testUnnestVirtualWithColumns2() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) +// @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) @Test public void testUnnestWithFilters() { @@ -5288,7 +5288,7 @@ public void testUnnestWithFilters() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) +// @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) @Test public void testUnnestWithFiltersWithExpressionInInnerQuery() { @@ -5324,7 +5324,7 @@ public void testUnnestWithFiltersWithExpressionInInnerQuery() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) +// @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) @Test public void testUnnestWithInFiltersWithExpressionInInnerQuery() { @@ -5403,7 +5403,7 @@ public void testUnnestWithFiltersInnerLimit() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) +// @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) @Test public void testUnnestWithFiltersInsideAndOutside() { @@ -5440,7 +5440,7 @@ public void testUnnestWithFiltersInsideAndOutside() ); } - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) +// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestWithFiltersInsideAndOutside1() { @@ -5461,7 +5461,7 @@ public void testUnnestWithFiltersInsideAndOutside1() not(equality("dim1", "foo", ColumnType.STRING)) ) ), - expressionVirtualColumn("j0.unnest", "\"dim3\"", ColumnType.STRING), + nestedExpressionVirtualColumn("j0.unnest", "\"dim3\"", ColumnType.STRING), or( in("j0.unnest", ImmutableList.of("a", "c")), new LikeDimFilter("j0.unnest", "_", null, null) @@ -5480,7 +5480,7 @@ public void testUnnestWithFiltersInsideAndOutside1() ); } - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) +// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestWithFiltersOutside() { @@ -5646,7 +5646,7 @@ public void testUnnestWithGroupByOrderByOnVirtualColumn() } @NotYetSupported(Modes.UNNEST_RESULT_MISMATCH) - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) +// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestWithJoinOnTheLeft() { @@ -6681,7 +6681,7 @@ public void testUnnestWithTimeFilterOnlyArrayColumn() ); } - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) +// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestWithTimeFilterAndAnotherFilter() { From b45b3ba4953f67f75c3f082f72e7ed320abf6855 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Mon, 11 Nov 2024 13:56:06 +0000 Subject: [PATCH 08/99] run trimmer --- .../calcite/planner/CalciteRulesManager.java | 18 ++++++++++----- .../calcite/planner/DruidRelFieldTrimmer.java | 23 ++++++++++++++++++- .../rule/logical/UnnestInputCleanupRule.java | 15 +++++++++--- .../sql/calcite/CalciteArraysQueryTest.java | 6 ++--- 4 files changed, 49 insertions(+), 13 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 83993338a423..b3931a7ed00d 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -542,12 +542,9 @@ public RelNode run( { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); final RelNode decorrelatedRel = RelDecorrelator.decorrelateQuery(rel, relBuilder); - if(true) { - return new DruidRelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); - } else { - return new RelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); - } + return runFieldTrimmer(relBuilder, decorrelatedRel); } + } /** Program that trims fields. */ @@ -558,7 +555,16 @@ private static class DruidTrimFieldsProgram implements Program { List lattices) { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); - return new DruidRelFieldTrimmer(null, relBuilder).trim(rel); + return runFieldTrimmer(relBuilder, rel); + } + } + + private static RelNode runFieldTrimmer(final RelBuilder relBuilder, final RelNode decorrelatedRel) + { + if(true) { + return new DruidRelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); + } else { + return new RelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); } } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 87537fca0b36..6d7f0d9e41dd 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -22,6 +22,7 @@ import org.apache.calcite.rel.RelHomogeneousShuttle; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.CorrelationId; +import org.apache.calcite.rel.core.TableScan; import org.apache.calcite.rel.logical.LogicalCorrelate; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataTypeField; @@ -57,10 +58,30 @@ public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuil @Override protected TrimResult dummyProject(int fieldCount, RelNode input) { + Mapping mapping = Mappings.createIdentity(input.getRowType().getFieldCount()); +// mapping = Mappings.create( +// MappingType.INVERSE_SURJECTION, +// fieldCount, +// 0 +// ); + return result(input, mapping); + } - return result(input, Mappings.createIdentity(input.getRowType().getFieldCount())); + public TrimResult trimFields( + final TableScan tableAccessRel, + ImmutableBitSet fieldsUsed, + Set extraFields) { + + Mapping mapping = Mappings.createIdentity(tableAccessRel.getRowType().getFieldCount()); +// mapping = Mappings.create( +// MappingType.INVERSE_SURJECTION, +// fieldCount, +// 0 +// ); + return result(tableAccessRel, mapping, tableAccessRel); } + public TrimResult trimFields(LogicalCorrelate correlate, ImmutableBitSet fieldsUsed, Set extraFields) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index 8ab3289883bf..bc7a1234e5ca 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -26,14 +26,17 @@ import org.apache.calcite.rel.core.Project; import org.apache.calcite.rel.rules.SubstitutionRule; import org.apache.calcite.rel.type.RelDataType; +import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.rex.RexBuilder; import org.apache.calcite.rex.RexInputRef; import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexShuttle; +import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.tools.RelBuilder; import org.apache.calcite.util.ImmutableBitSet; import org.apache.druid.error.DruidException; import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** @@ -134,9 +137,10 @@ public void onMatch(RelOptRuleCall call) rn = rexBuilder.makeNullLiteral(type); } else { // bail out - return; +// return; // reutrn; -// rn= rexBuilder.makeCall(type, SqlStdOperatorTable.CURRENT_VALUE, Collections.emptyList()); +// rn =rexBuilder.makeAbstractCast(type, rexBuilder.makeNullLiteral(type), true); + rn= rexBuilder.makeCall(type, SqlStdOperatorTable.CURRENT_TIMESTAMP, Collections.emptyList()); } projectFields.set( @@ -145,7 +149,12 @@ public void onMatch(RelOptRuleCall call) ); builder.project(projectFields); - call.transformTo(builder.build()); + RelNode build = builder.build(); + RelDataTypeField newField = build.getRowType().getFieldList().get(inputIndex); + if(newField.getType().isNullable() != type.isNullable()) { + int asd = 1; + } + call.transformTo(build); call.getPlanner().prune(unnest); } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 395e1559f71f..64d3cd6316aa 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -5502,7 +5502,7 @@ public void testUnnestWithFiltersOutside() not(equality("dim1", "foo", ColumnType.STRING)) ) ), - expressionVirtualColumn("j0.unnest", "\"dim3\"", ColumnType.STRING), + nestedExpressionVirtualColumn("j0.unnest", "\"dim3\"", ColumnType.STRING), or( in("j0.unnest", ImmutableList.of("a", "c")), new LikeDimFilter("j0.unnest", "_", null, null) @@ -5645,7 +5645,7 @@ public void testUnnestWithGroupByOrderByOnVirtualColumn() ); } - @NotYetSupported(Modes.UNNEST_RESULT_MISMATCH) +// @NotYetSupported(Modes.UNNEST_RESULT_MISMATCH) // @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestWithJoinOnTheLeft() @@ -5674,7 +5674,7 @@ public void testUnnestWithJoinOnTheLeft() "(\"dim2\" == \"j0.dim2\")", JoinType.INNER ), - expressionVirtualColumn("_j0.unnest", "\"dim3\"", ColumnType.STRING), + nestedExpressionVirtualColumn("_j0.unnest", "\"dim3\"", ColumnType.STRING), null )) .intervals(querySegmentSpec(Filtration.eternity())) From d38215fd5a8107dcf32c36468260d39b03c0c36a Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 12 Nov 2024 11:46:30 +0000 Subject: [PATCH 09/99] ok-but alon trim should have affected native query - right? --- .../calcite/planner/CalciteRulesManager.java | 13 ++- .../sql/calcite/CalciteArraysQueryTest.java | 90 +++++++++++++++++++ 2 files changed, 101 insertions(+), 2 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index b3931a7ed00d..65cf2d942632 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -286,7 +286,8 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder.addRuleInstance(new UnnestInputCleanupRule()); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram() + new DruidTrimFieldsProgram(), + Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE) ); } @@ -542,7 +543,7 @@ public RelNode run( { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); final RelNode decorrelatedRel = RelDecorrelator.decorrelateQuery(rel, relBuilder); - return runFieldTrimmer(relBuilder, decorrelatedRel); + return runFieldTrimmer2(relBuilder, decorrelatedRel); } } @@ -559,6 +560,14 @@ private static class DruidTrimFieldsProgram implements Program { } } + private static RelNode runFieldTrimmer2(RelBuilder relBuilder, RelNode decorrelatedRel) + { + RelNode a = new RelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); + a=decorrelatedRel; + return runFieldTrimmer(relBuilder, a); + } + + private static RelNode runFieldTrimmer(final RelBuilder relBuilder, final RelNode decorrelatedRel) { if(true) { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 64d3cd6316aa..68645f54e72e 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -6789,6 +6789,96 @@ public void testUnnestWithTimeFilterOnlyNested() ); } + public void testQuery1( + final String sql, + final Map queryContext, + final List> expectedQueries, + final List expectedResults + ) + { + testBuilder() + .queryContext(queryContext) + .sql(sql) + .expectedQueries(expectedQueries) + .expectedResults(expectedResults) + .run(); + } + + + @Test + public void testUnnestWithTimeFilterOnlyNestedIsBad0() + { + testQuery1( + "select d,c from foo CROSS JOIN UNNEST(ARRAY[m1,m2]) as un(d) CROSS JOIN unnest(MV_TO_ARRAY(dim3)) as u(c)" + + " where __time >= TIMESTAMP '2000-01-02 00:00:00' and __time <= TIMESTAMP '2000-01-03 00:10:00'", + QUERY_CONTEXT_UNNEST, + ImmutableList.of( + Druids.newScanQueryBuilder() + .dataSource(UnnestDataSource.create( + UnnestDataSource.create( + FilteredDataSource.create( + new TableDataSource(CalciteTests.DATASOURCE1), + range("__time", ColumnType.LONG, 946771200000L, 946858200000L, false, false) + ), + expressionVirtualColumn("j0.unnest", "array(\"m1\",\"m2\")", ColumnType.FLOAT_ARRAY), + null + ), + nestedExpressionVirtualColumn("_j0.unnest", "\"dim3\"", ColumnType.STRING), + null + )) + .intervals(querySegmentSpec(Intervals.of("2000-01-02T00:00:00.000Z/2000-01-03T00:10:00.001Z"))) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .context(QUERY_CONTEXT_UNNEST) + .columns(ImmutableList.of("_j0.unnest", "j0.unnest")) + .build() + ), + ImmutableList.of( + new Object[]{2.0F, "b"}, + new Object[]{2.0F, "c"}, + new Object[]{2.0F, "b"}, + new Object[]{2.0F, "c"}, + new Object[]{3.0F, "d"}, + new Object[]{3.0F, "d"} ) + ); + } + + @Test + public void testUnnestWithTimeFilterOnlyNestedIsBad() + { + testQuery1( + "select d from foo CROSS JOIN UNNEST(ARRAY[m1,m2]) as un(d) CROSS JOIN unnest(MV_TO_ARRAY(dim3)) as u(c)" + + " where __time >= TIMESTAMP '2000-01-02 00:00:00' and __time <= TIMESTAMP '2000-01-03 00:10:00'", + QUERY_CONTEXT_UNNEST, + ImmutableList.of( + Druids.newScanQueryBuilder() + .dataSource(UnnestDataSource.create( + UnnestDataSource.create( + FilteredDataSource.create( + new TableDataSource(CalciteTests.DATASOURCE1), + range("__time", ColumnType.LONG, 946771200000L, 946858200000L, false, false) + ), + expressionVirtualColumn("j0.unnest", "array(\"m1\",\"m2\")", ColumnType.FLOAT_ARRAY), + null + ), + nestedExpressionVirtualColumn("_j0.unnest", "\"dim3\"", ColumnType.STRING), + null + )) + .intervals(querySegmentSpec(Intervals.of("2000-01-02T00:00:00.000Z/2000-01-03T00:10:00.001Z"))) + .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) + .context(QUERY_CONTEXT_UNNEST) + .columns(ImmutableList.of("j0.unnest")) + .build() + ), + ImmutableList.of( + new Object[]{2.0F}, + new Object[]{2.0F}, + new Object[]{2.0F}, + new Object[]{2.0F}, + new Object[]{3.0F}, + new Object[]{3.0F}) + ); + } + @Test public void testUnnestWithTimeFilterOnlyNestedAndNestedAgain() { From 322ec81fb0826734bdad4c1aa0607b82ea8ba67d Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 12 Nov 2024 14:12:30 +0000 Subject: [PATCH 10/99] make some assert function and fail with that --- .../org/apache/druid/math/expr/Function.java | 25 +++++++ .../org/apache/druid/query/QueryContexts.java | 2 +- .../RuntimeAssertOperatorConversion.java | 65 +++++++++++++++++++ .../calcite/planner/DruidOperatorTable.java | 2 + .../calcite/planner/DruidRelFieldTrimmer.java | 15 ++--- .../rule/logical/UnnestInputCleanupRule.java | 27 +++++++- .../sql/calcite/CalciteArraysQueryTest.java | 3 + 7 files changed, 127 insertions(+), 12 deletions(-) create mode 100644 sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RuntimeAssertOperatorConversion.java diff --git a/processing/src/main/java/org/apache/druid/math/expr/Function.java b/processing/src/main/java/org/apache/druid/math/expr/Function.java index f79a0fc5a743..a12ac7612da5 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/Function.java +++ b/processing/src/main/java/org/apache/druid/math/expr/Function.java @@ -4341,4 +4341,29 @@ protected HumanReadableBytes.UnitSystem getUnitSystem() return HumanReadableBytes.UnitSystem.DECIMAL; } } + + class RuntimeAssert extends UnivariateFunction + { + public static final String NAME = "assert"; + + @Override + public String name() + { + return NAME; + } + + @Nullable + @Override + public ExpressionType getOutputType(Expr.InputBindingInspector inspector, List args) + { + return ExpressionType.STRING; + } + + @Override + protected ExprEval eval(ExprEval param) + { + throw DruidException.defensive("Runtime assertion: " + param.asString()); + } + } + } diff --git a/processing/src/main/java/org/apache/druid/query/QueryContexts.java b/processing/src/main/java/org/apache/druid/query/QueryContexts.java index 759a9b49437e..f89fda95b7b0 100644 --- a/processing/src/main/java/org/apache/druid/query/QueryContexts.java +++ b/processing/src/main/java/org/apache/druid/query/QueryContexts.java @@ -127,7 +127,7 @@ public class QueryContexts public static final boolean DEFAULT_ENABLE_SQL_JOIN_LEFT_SCAN_DIRECT = false; public static final boolean DEFAULT_USE_FILTER_CNF = false; public static final boolean DEFAULT_SECONDARY_PARTITION_PRUNING = true; - public static final boolean DEFAULT_ENABLE_DEBUG = false; + public static final boolean DEFAULT_ENABLE_DEBUG = true; public static final int DEFAULT_IN_SUB_QUERY_THRESHOLD = Integer.MAX_VALUE; public static final int DEFAULT_IN_FUNCTION_THRESHOLD = 100; public static final int DEFAULT_IN_FUNCTION_EXPR_THRESHOLD = 2; diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RuntimeAssertOperatorConversion.java b/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RuntimeAssertOperatorConversion.java new file mode 100644 index 000000000000..f24565803e9f --- /dev/null +++ b/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RuntimeAssertOperatorConversion.java @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.sql.calcite.expression.builtin; + +import org.apache.calcite.rex.RexNode; +import org.apache.calcite.sql.SqlFunction; +import org.apache.calcite.sql.SqlFunctionCategory; +import org.apache.calcite.sql.SqlOperator; +import org.apache.calcite.sql.type.OperandTypes; +import org.apache.calcite.sql.type.SqlTypeName; +import org.apache.druid.java.util.common.StringUtils; +import org.apache.druid.math.expr.Function; +import org.apache.druid.segment.column.RowSignature; +import org.apache.druid.sql.calcite.expression.DruidExpression; +import org.apache.druid.sql.calcite.expression.OperatorConversions; +import org.apache.druid.sql.calcite.expression.SqlOperatorConversion; +import org.apache.druid.sql.calcite.planner.PlannerContext; + +public class RuntimeAssertOperatorConversion implements SqlOperatorConversion +{ + private final SqlFunction sqlFunction; + + public RuntimeAssertOperatorConversion() + { + this.sqlFunction = OperatorConversions + .operatorBuilder(StringUtils.toUpperCase(Function.RuntimeAssert.NAME)) + .operandTypeChecker(OperandTypes.ANY) + .functionCategory(SqlFunctionCategory.SYSTEM) + .returnTypeNullable(SqlTypeName.ANY) + .build(); + } + + @Override + public SqlOperator calciteOperator() + { + return sqlFunction; + } + + @Override + public DruidExpression toDruidExpression( + final PlannerContext plannerContext, + final RowSignature rowSignature, + final RexNode rexNode + ) + { + return OperatorConversions.convertDirectCall(plannerContext, rowSignature, rexNode, Function.RuntimeAssert.NAME); + } +} diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidOperatorTable.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidOperatorTable.java index 0fb1c9fb9ff0..4b5659e489cd 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidOperatorTable.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidOperatorTable.java @@ -110,6 +110,7 @@ import org.apache.druid.sql.calcite.expression.builtin.RepeatOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.ReverseOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.RightOperatorConversion; +import org.apache.druid.sql.calcite.expression.builtin.RuntimeAssertOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.SafeDivideOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.ScalarInArrayOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.SearchOperatorConversion; @@ -432,6 +433,7 @@ public class DruidOperatorTable implements SqlOperatorTable .addAll(CUSTOM_MATH_OPERATOR_CONVERSIONS) .addAll(NESTED_DATA_OPERATOR_CONVERSIONS) .add(TableAppendMacro.OPERATOR_CONVERSION) + .add(new RuntimeAssertOperatorConversion()) .build(); // Operators that have no conversion, but are handled in the convertlet table, so they still need to exist. diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 6d7f0d9e41dd..9c47d2777f20 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -48,6 +48,7 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer { private RelBuilder relBuilder; + private boolean trimTableScan = true; public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuilder) { @@ -71,14 +72,12 @@ public TrimResult trimFields( final TableScan tableAccessRel, ImmutableBitSet fieldsUsed, Set extraFields) { - - Mapping mapping = Mappings.createIdentity(tableAccessRel.getRowType().getFieldCount()); -// mapping = Mappings.create( -// MappingType.INVERSE_SURJECTION, -// fieldCount, -// 0 -// ); - return result(tableAccessRel, mapping, tableAccessRel); + if (trimTableScan) { + return super.trimFields(tableAccessRel, fieldsUsed, extraFields); + } else { + Mapping mapping = Mappings.createIdentity(tableAccessRel.getRowType().getFieldCount()); + return result(tableAccessRel, mapping, tableAccessRel); + } } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index bc7a1234e5ca..10784f6a61e5 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -19,6 +19,8 @@ package org.apache.druid.sql.calcite.rule.logical; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; import org.apache.calcite.plan.RelOptRule; import org.apache.calcite.plan.RelOptRuleCall; import org.apache.calcite.plan.RelOptUtil.InputFinder; @@ -35,6 +37,8 @@ import org.apache.calcite.tools.RelBuilder; import org.apache.calcite.util.ImmutableBitSet; import org.apache.druid.error.DruidException; +import org.apache.druid.sql.calcite.expression.builtin.RuntimeAssertOperatorConversion; + import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -139,15 +143,32 @@ public void onMatch(RelOptRuleCall call) // bail out // return; // reutrn; -// rn =rexBuilder.makeAbstractCast(type, rexBuilder.makeNullLiteral(type), true); - rn= rexBuilder.makeCall(type, SqlStdOperatorTable.CURRENT_TIMESTAMP, Collections.emptyList()); + rn=null; + int i=4; + if(i==1) { + rn =rexBuilder.makeReinterpretCast(type, rexBuilder.makeNullLiteral(type), null); + } + if(i==2) { + rn =rexBuilder.makeAbstractCast(type, rexBuilder.makeNullLiteral(type), true); + } + + if(i==3) { + rn = rexBuilder.makeCall(type, SqlStdOperatorTable.CURRENT_TIMESTAMP, Collections.emptyList()); + } + if(i==4) { + rn = rexBuilder.makeCall( + type, + new RuntimeAssertOperatorConversion().calciteOperator(), + ImmutableList.of(rexBuilder.makeLiteral("Not possible to access the unnested function's input")) + ); + } } projectFields.set( inputIndex, rn ); - builder.project(projectFields); + builder.project(projectFields, ImmutableSet.of() , true); RelNode build = builder.build(); RelDataTypeField newField = build.getRowType().getFieldList().get(inputIndex); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 68645f54e72e..2ffab4a6c6f9 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -6340,6 +6340,9 @@ public void testUnnestWithCountOnColumn() @Test public void testUnnestWithGroupByHavingSelector() { +// if(true) { +// throw new RuntimeException("tjhs"); +// } cannotVectorize(); testQuery( "SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) GROUP BY d3 HAVING d3='b'", From e8f06bf90d701fb4214091125c9b585c57914ffc Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 12 Nov 2024 14:19:29 +0000 Subject: [PATCH 11/99] make helper method --- .../druid/sql/calcite/BaseCalciteQueryTest.java | 12 ++++++++++++ .../druid/sql/calcite/CalciteArraysQueryTest.java | 7 ++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java index 95d3d5228938..a98fe4124113 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java @@ -1658,4 +1658,16 @@ public File getResourceAsTemporaryFile(final String resource) } return file; } + + /** + * Adds shadowing in non-decoupled mode planning. + * + * Due to some circumstances - DruidUnnestRel have exposed all columns during planning; + * which made the VC registry to see some columns which are not selected ; and as a result + * it renamed some columns with underscores. + */ + public String ds(String colName) + { + return "_" + colName; + } } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 2ffab4a6c6f9..3bf2a1a2b9a9 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -5612,13 +5612,13 @@ public void testUnnestWithGroupByOrderByOnVirtualColumn() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setContext(QUERY_CONTEXT_UNNEST) - .setDimensions(new DefaultDimensionSpec("j0.unnest", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("j0.unnest", ds("d0"), ColumnType.STRING)) .setGranularity(Granularities.ALL) .setLimitSpec( DefaultLimitSpec .builder() .orderBy(new OrderByColumnSpec( - "_d0", + ds("d0"), OrderByColumnSpec.Direction.DESCENDING, StringComparators.LEXICOGRAPHIC )) @@ -6340,9 +6340,6 @@ public void testUnnestWithCountOnColumn() @Test public void testUnnestWithGroupByHavingSelector() { -// if(true) { -// throw new RuntimeException("tjhs"); -// } cannotVectorize(); testQuery( "SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) GROUP BY d3 HAVING d3='b'", From 04ab28f4cdf01d709368ebaeada187c6cb6a2430 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 12 Nov 2024 14:28:25 +0000 Subject: [PATCH 12/99] one way --- .../org/apache/druid/sql/calcite/CalciteArraysQueryTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 3bf2a1a2b9a9..e32d5b72714e 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -5618,7 +5618,7 @@ public void testUnnestWithGroupByOrderByOnVirtualColumn() DefaultLimitSpec .builder() .orderBy(new OrderByColumnSpec( - ds("d0"), + super.ds("d0"), OrderByColumnSpec.Direction.DESCENDING, StringComparators.LEXICOGRAPHIC )) From c49fc2796b5062d5886bc1ddd36ac3e524507c21 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 12 Nov 2024 15:04:11 +0000 Subject: [PATCH 13/99] rename: d1/dbl1 --- .../sql/calcite/CalciteArraysQueryTest.java | 2 +- .../druid/sql/calcite/CalciteQueryTest.java | 140 +++++++++--------- .../sql/calcite/util/TestDataBuilder.java | 25 ++-- 3 files changed, 85 insertions(+), 82 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index e32d5b72714e..a53252712f34 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -5895,7 +5895,7 @@ public void testUnnestWithInvalidINFiltersOnUnnestedColumn() public void testUnnestWithNotFiltersOnUnnestedColumn() { testQuery( - "SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3!='d' ", + "SELECT d3,MV_TO_ARRAY(dim3) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3!='d' ", QUERY_CONTEXT_UNNEST, ImmutableList.of( Druids.newScanQueryBuilder() diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 791e5bf4bb79..4164973a3be8 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -1058,7 +1058,7 @@ public void testAnyAggregator() public void testAnyAggregatorsOnHeapNumericNulls() { testQuery( - "SELECT ANY_VALUE(l1), ANY_VALUE(d1), ANY_VALUE(f1) FROM druid.numfoo", + "SELECT ANY_VALUE(l1), ANY_VALUE(dbl1), ANY_VALUE(f1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1119,17 +1119,17 @@ public void testLatestVectorAggregatorsOnTimeExpression() public void testAnyAggregatorsOffHeapNumericNulls() { testQuery( - "SELECT ANY_VALUE(l1), ANY_VALUE(d1), ANY_VALUE(f1) FROM druid.numfoo GROUP BY dim2", + "SELECT ANY_VALUE(l1), ANY_VALUE(dbl1), ANY_VALUE(f1) FROM druid.numfoo GROUP BY dim2", ImmutableList.of( GroupByQuery.builder() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "d0"))) .setAggregatorSpecs( aggregators( new LongAnyAggregatorFactory("a0", "l1"), - new DoubleAnyAggregatorFactory("a1", "d1"), + new DoubleAnyAggregatorFactory("a1", "dbl1"), new FloatAnyAggregatorFactory("a2", "f1") ) ) @@ -1246,7 +1246,7 @@ public void testStringLatestGroupBy() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "d0"))) .setAggregatorSpecs(aggregators( new StringLastAggregatorFactory("a0", "dim4", null, 10) ) @@ -1712,7 +1712,7 @@ public void testStringAnyInSubquery() public void testEarliestAggregatorsNumericNulls() { testQuery( - "SELECT EARLIEST(l1), EARLIEST(d1), EARLIEST(f1) FROM druid.numfoo", + "SELECT EARLIEST(l1), EARLIEST(dbl1), EARLIEST(f1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1739,7 +1739,7 @@ public void testLatestAggregatorsNumericNull() { msqIncompatible(); testQuery( - "SELECT LATEST(l1), LATEST(d1), LATEST(f1) FROM druid.numfoo", + "SELECT LATEST(l1), LATEST(dbl1), LATEST(f1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1780,7 +1780,7 @@ public void testFirstLatestAggregatorsSkipNulls() ); } testQuery( - "SELECT EARLIEST(dim1, 32), LATEST(l1), LATEST(d1), LATEST(f1) " + "SELECT EARLIEST(dim1, 32), LATEST(l1), LATEST(dbl1), LATEST(f1) " + "FROM druid.numfoo " + "WHERE dim1 IS NOT NULL AND l1 IS NOT NULL AND d1 IS NOT NULL AND f1 is NOT NULL", ImmutableList.of( @@ -1907,7 +1907,7 @@ public void testOrderByEarliestFloat() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new FloatFirstAggregatorFactory("a0", "f1", null) @@ -1946,13 +1946,13 @@ public void testOrderByEarliestDouble() ); } testQuery( - "SELECT dim1, EARLIEST(d1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", + "SELECT dim1, EARLIEST(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new DoubleFirstAggregatorFactory("a0", "d1", null) @@ -1997,7 +1997,7 @@ public void testOrderByEarliestLong() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new LongFirstAggregatorFactory("a0", "l1", null) @@ -2044,7 +2044,7 @@ public void testOrderByLatestFloat() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new FloatLastAggregatorFactory("a0", "f1", null) @@ -2084,16 +2084,16 @@ public void testOrderByLatestDouble() ); } testQuery( - "SELECT dim1, LATEST(d1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", + "SELECT dim1, LATEST(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( - new DoubleLastAggregatorFactory("a0", "d1", null) + new DoubleLastAggregatorFactory("a0", "dbl1", null) ) ) .metric(new InvertedTopNMetricSpec(new NumericTopNMetricSpec("a0"))) @@ -2136,7 +2136,7 @@ public void testOrderByLatestLong() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new LongLastAggregatorFactory("a0", "l1", null) @@ -2187,7 +2187,7 @@ public void testOrderByAnyFloat() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new FloatAnyAggregatorFactory("a0", "f1") @@ -2231,13 +2231,13 @@ public void testOrderByAnyDouble() ); } testQuery( - "SELECT dim1, ANY_VALUE(d1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", + "SELECT dim1, ANY_VALUE(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new DoubleAnyAggregatorFactory("a0", "d1") @@ -2287,7 +2287,7 @@ public void testOrderByAnyLong() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new LongAnyAggregatorFactory("a0", "l1") @@ -2703,7 +2703,7 @@ public void testHavingOnExactCountDistinct() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING))) .setAggregatorSpecs( aggregators( useDefault @@ -3703,7 +3703,7 @@ public void testNullDoubleTopN() new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("d1", "_d0", ColumnType.DOUBLE)) + .dimension(new DefaultDimensionSpec("d1", "d0", ColumnType.DOUBLE)) .threshold(10) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .metric( @@ -3747,7 +3747,7 @@ public void testNullFloatTopN() new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("f1", "_d0", ColumnType.FLOAT)) + .dimension(new DefaultDimensionSpec("f1", "d0", ColumnType.FLOAT)) .threshold(10) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .metric( @@ -3791,7 +3791,7 @@ public void testNullLongTopN() new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("l1", "_d0", ColumnType.LONG)) + .dimension(new DefaultDimensionSpec("l1", "d0", ColumnType.LONG)) .threshold(10) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .metric( @@ -3873,7 +3873,7 @@ public void testDoublePredicateFilterNulls() testQuery( "SELECT COUNT(*)\n" + "FROM druid.numfoo\n" - + "WHERE d1 > 0", + + "WHERE dbl1 > 0", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -4907,7 +4907,7 @@ public void testSimpleLongAggregations() public void testSimpleDoubleAggregations() { testQuery( - "SELECT MIN(d1), MAX(d1) FROM druid.numfoo", + "SELECT MIN(dbl1), MAX(dbl1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -4953,7 +4953,7 @@ public void testSimpleFloatAggregations() public void testSimpleAggregations() { testQuery( - "SELECT COUNT(*), COUNT(cnt), COUNT(dim1), AVG(cnt), SUM(cnt), SUM(cnt) + MIN(cnt) + MAX(cnt), COUNT(dim2), COUNT(d1), AVG(d1) FROM druid.numfoo", + "SELECT COUNT(*), COUNT(cnt), COUNT(dim1), AVG(cnt), SUM(cnt), SUM(cnt) + MIN(cnt) + MAX(cnt), COUNT(dim2), COUNT(dbl1), AVG(dbl1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() @@ -7656,7 +7656,7 @@ public void testExactCountDistinctWithGroupingAndOtherAggregators() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0"))) .setAggregatorSpecs(aggregators( new LongSumAggregatorFactory("_a0", "a0"), new FilteredAggregatorFactory( @@ -7726,7 +7726,7 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo ) .setGranularity(Granularities.ALL) .setInterval(querySegmentSpec(Filtration.eternity())) - .setDimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING)) .setAggregatorSpecs( new FilteredAggregatorFactory( new CountAggregatorFactory("a0"), @@ -7757,7 +7757,7 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo ) ) .setInterval(querySegmentSpec(Filtration.eternity())) - .setDimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING)) .setAggregatorSpecs( NullHandling.sqlCompatible() ? new FilteredAggregatorFactory( @@ -7898,7 +7898,7 @@ public void testMultipleExactCountDistinctWithGroupingUsingGroupingSets() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.LONG))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.LONG))) .setAggregatorSpecs(aggregators( new FilteredAggregatorFactory( new CountAggregatorFactory("_a0"), @@ -8086,8 +8086,8 @@ public void testNestedGroupBy() ) ) .setDimensions(dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG), - new DefaultDimensionSpec("d0", "_d1", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.LONG), + new DefaultDimensionSpec("d0", "d1", ColumnType.STRING) )) .setAggregatorSpecs( aggregators( @@ -8143,7 +8143,7 @@ public void testDoubleNestedGroupBy() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d1", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("d1", "d0"))) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("_a0", "a0"))) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -8200,7 +8200,7 @@ public void testDoubleNestedGroupBy2() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("d1", "_d0")) + .setDimensions(new DefaultDimensionSpec("d1", "d0")) .setAggregatorSpecs(new LongMaxAggregatorFactory("_a0", "a0")) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -8539,7 +8539,7 @@ public void testHistogramUsingSubquery() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("a0", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("a0", "d0"))) .setAggregatorSpecs(aggregators( new CountAggregatorFactory("_a0") )) @@ -8584,14 +8584,14 @@ public void testHistogramUsingSubqueryWithSort() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("a0", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("a0", "d0"))) .setAggregatorSpecs(aggregators( new CountAggregatorFactory("_a0") )) .setLimitSpec( new DefaultLimitSpec( ImmutableList.of(new OrderByColumnSpec( - "_d0", + "d0", OrderByColumnSpec.Direction.ASCENDING, StringComparators.LEXICOGRAPHIC )), @@ -9038,8 +9038,8 @@ public void testGroupByLimitPushdownExtraction() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0"), - new ExtractionDimensionSpec("dim5", "_d1", new SubstringDimExtractionFn(0, 1)) + new DefaultDimensionSpec("v0", "d0"), + new ExtractionDimensionSpec("dim5", "d1", new SubstringDimExtractionFn(0, 1)) ) ) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) @@ -10367,14 +10367,14 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValues() + " count(*),\n" + " COUNT(DISTINCT dim1),\n" + " APPROX_COUNT_DISTINCT(distinct dim1),\n" - + " sum(d1),\n" - + " max(d1),\n" - + " min(d1),\n" + + " sum(dbl1),\n" + + " max(dbl1),\n" + + " min(dbl1),\n" + " sum(l1),\n" + " max(l1),\n" + " min(l1),\n" + " avg(l1),\n" - + " avg(d1)\n" + + " avg(dbl1)\n" + "FROM druid.numfoo WHERE dim2 = 0", ImmutableList.of( Druids.newTimeseriesQueryBuilder() @@ -10634,14 +10634,14 @@ public void testGroupByAggregatorDefaultValues() + " count(*) FILTER(WHERE dim1 = 'nonexistent'),\n" + " COUNT(DISTINCT dim1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " APPROX_COUNT_DISTINCT(distinct dim1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " sum(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " max(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " min(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + " sum(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + " max(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + " min(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " sum(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " max(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " min(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " avg(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " avg(d1) FILTER(WHERE dim1 = 'nonexistent')\n" + + " avg(dbl1) FILTER(WHERE dim1 = 'nonexistent')\n" + "FROM druid.numfoo WHERE dim2 = 'a' GROUP BY dim2", ImmutableList.of( GroupByQuery.builder() @@ -10650,7 +10650,7 @@ public void testGroupByAggregatorDefaultValues() .setDimFilter(equality("dim2", "a", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) - .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -10807,7 +10807,7 @@ public void testGroupByAggregatorDefaultValuesNonVectorized() .setDimFilter(equality("dim2", "a", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) - .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -11458,17 +11458,17 @@ public void testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("d1", "_d0"), - new DefaultDimensionSpec("p0", "_d1", ColumnType.LONG) + new DefaultDimensionSpec("d1", "d0"), + new DefaultDimensionSpec("p0", "d1", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new DoubleSumAggregatorFactory("_a0", "a0"))) .setLimitSpec( new DefaultLimitSpec( ImmutableList.of( - new OrderByColumnSpec("_d0", OrderByColumnSpec.Direction.ASCENDING), + new OrderByColumnSpec("d0", OrderByColumnSpec.Direction.ASCENDING), new OrderByColumnSpec( - "_d1", + "d1", Direction.DESCENDING, StringComparators.NUMERIC ) @@ -12521,8 +12521,8 @@ public void testSortProjectAfterNestedGroupBy() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("d0", "_d0", ColumnType.LONG), - new DefaultDimensionSpec("d1", "_d1", ColumnType.STRING) + new DefaultDimensionSpec("d0", "d0", ColumnType.LONG), + new DefaultDimensionSpec("d1", "d1", ColumnType.STRING) ) ) .setAggregatorSpecs( @@ -13536,7 +13536,7 @@ public void testGroupByWithLiteralInSubqueryGrouping() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("dim4", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("dim4", "d0", ColumnType.STRING)) .setContext(QUERY_CONTEXT_DEFAULT) .build() ) @@ -13548,15 +13548,15 @@ public void testGroupByWithLiteralInSubqueryGrouping() ), expressionVirtualColumn( "v1", - "case_searched((\"_d0\" == 'b'),\"_d0\",null)", + "case_searched((\"d0\" == 'b'),\"d0\",null)", ColumnType.STRING ) ) .setInterval(querySegmentSpec(Filtration.eternity())) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "d0", ColumnType.STRING), - new DefaultDimensionSpec("v1", "d1", ColumnType.STRING) + new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING), + new DefaultDimensionSpec("v1", "_d1", ColumnType.STRING) ) ) .setGranularity(Granularities.ALL) @@ -14129,7 +14129,7 @@ public void testCountAndAverageByConstantVirtualColumn() ) .setGranularity(Granularities.ALL) .setVirtualColumns(VirtualColumns.create(virtualColumns)) - .setDimensions(new DefaultDimensionSpec("dim5", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("dim5", "d0", ColumnType.STRING)) .setAggregatorSpecs(aggs) .setPostAggregatorSpecs( ImmutableList.of( @@ -14304,7 +14304,7 @@ public void testBitwiseAggregatorsGroupBy() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("dim2", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("dim2", "d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -14551,7 +14551,7 @@ public void testStringAggNumeric() { cannotVectorize(); testQuery( - "SELECT STRING_AGG(l1, ','), STRING_AGG(DISTINCT l1, ','), STRING_AGG(d1, ','), STRING_AGG(DISTINCT d1, ','), STRING_AGG(f1, ','), STRING_AGG(DISTINCT f1, ',') FROM numfoo", + "SELECT STRING_AGG(l1, ','), STRING_AGG(DISTINCT l1, ','), STRING_AGG(dbl1, ','), STRING_AGG(DISTINCT d1, ','), STRING_AGG(f1, ','), STRING_AGG(DISTINCT f1, ',') FROM numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -15173,7 +15173,7 @@ public void testGreatestFunctionForNumberWithIsNull() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Intervals.ETERNITY)) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "_d0")) + .addDimension(new DefaultDimensionSpec("dim1", "d0")) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "0", ColumnType.LONG) )) @@ -15200,7 +15200,7 @@ public void testGreatestFunctionForNumberWithIsNull() ) ) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "_d0")) + .addDimension(new DefaultDimensionSpec("dim1", "d0")) .addAggregator(new LongMaxAggregatorFactory("a0", "v0")) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "isnull(\"a0\")", ColumnType.LONG) @@ -15238,7 +15238,7 @@ public void testGreatestFunctionForStringWithIsNull() ) ) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("l1", "_d0", ColumnType.LONG)) + .addDimension(new DefaultDimensionSpec("l1", "d0", ColumnType.LONG)) .addAggregator(new StringLastAggregatorFactory("a0", "v0", null, 1024)) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "isnull(\"a0\")", ColumnType.LONG) @@ -15280,7 +15280,7 @@ public void testSubqueryTypeMismatchWithLiterals() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Intervals.ETERNITY)) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "_d0", ColumnType.STRING)) + .addDimension(new DefaultDimensionSpec("dim1", "d0", ColumnType.STRING)) .addAggregator(new LongSumAggregatorFactory("a0", "l1")) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "case_searched((\"a0\" == 0),1,0)", ColumnType.LONG))) @@ -16273,8 +16273,8 @@ public void testLatestByAggregatorOnSecondaryTimestampGroupBy() .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) .setDimensions( - new DefaultDimensionSpec("__time", "_d0", ColumnType.LONG), - new DefaultDimensionSpec("m1", "_d1", ColumnType.FLOAT) + new DefaultDimensionSpec("__time", "d0", ColumnType.LONG), + new DefaultDimensionSpec("m1", "d1", ColumnType.FLOAT) ) .setAggregatorSpecs(aggregators(new FloatLastAggregatorFactory("a0", "m1", "m2"))) .setContext(OUTER_LIMIT_CONTEXT) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java index 046ff4b48110..63640a1deb62 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java @@ -115,6 +115,9 @@ */ public class TestDataBuilder { + private static final String D1 = "dbl1"; + private static final String D2 = "dbl2"; + private static final ObjectMapper MAPPER = new DefaultObjectMapper(); public static final String TIMESTAMP_COLUMN = "t"; @@ -171,8 +174,8 @@ public Optional build( "dim5", "dim6" ))) - .add(new DoubleDimensionSchema("d1")) - .add(new DoubleDimensionSchema("d2")) + .add(new DoubleDimensionSchema(D1)) + .add(new DoubleDimensionSchema(D2)) .add(new FloatDimensionSchema("f1")) .add(new FloatDimensionSchema("f2")) .add(new LongDimensionSchema("l1")) @@ -390,7 +393,7 @@ public Optional build( .put("t", "2000-01-01") .put("m1", "1.0") .put("m2", "1.0") - .put("d1", 1.0) + .put(D1, 1.0) .put("f1", 1.0f) .put("l1", 7L) .put("dim1", "") @@ -404,8 +407,8 @@ public Optional build( .put("t", "2000-01-02") .put("m1", "2.0") .put("m2", "2.0") - .put("d1", 1.7) - .put("d2", 1.7) + .put(D1, 1.7) + .put(D2, 1.7) .put("f1", 0.1f) .put("f2", 0.1f) .put("l1", 325323L) @@ -421,8 +424,8 @@ public Optional build( .put("t", "2000-01-03") .put("m1", "3.0") .put("m2", "3.0") - .put("d1", 0.0) - .put("d2", 0.0) + .put(D1, 0.0) + .put(D2, 0.0) .put("f1", 0.0) .put("f2", 0.0) .put("l1", 0) @@ -594,8 +597,8 @@ public Optional build( x.get("dim3"), x.get("dim4"), x.get("dim5"), - x.get("d1"), - x.get("d2"), + x.get(D1), + x.get(D2), x.get("f1"), x.get("f2"), x.get("l1"), @@ -607,8 +610,8 @@ public Optional build( .add("dim3", ColumnType.STRING) .add("dim4", ColumnType.STRING) .add("dim5", ColumnType.STRING) - .add("d1", ColumnType.DOUBLE) - .add("d2", ColumnType.DOUBLE) + .add(D1, ColumnType.DOUBLE) + .add(D2, ColumnType.DOUBLE) .add("f1", ColumnType.FLOAT) .add("f2", ColumnType.FLOAT) .add("l1", ColumnType.LONG) From 0d03cc558781cfd4093c0ff7c87f03c7cc65e027 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 12 Nov 2024 15:04:14 +0000 Subject: [PATCH 14/99] Revert "rename: d1/dbl1" This reverts commit c49fc2796b5062d5886bc1ddd36ac3e524507c21. --- .../sql/calcite/CalciteArraysQueryTest.java | 2 +- .../druid/sql/calcite/CalciteQueryTest.java | 140 +++++++++--------- .../sql/calcite/util/TestDataBuilder.java | 25 ++-- 3 files changed, 82 insertions(+), 85 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index a53252712f34..e32d5b72714e 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -5895,7 +5895,7 @@ public void testUnnestWithInvalidINFiltersOnUnnestedColumn() public void testUnnestWithNotFiltersOnUnnestedColumn() { testQuery( - "SELECT d3,MV_TO_ARRAY(dim3) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3!='d' ", + "SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3!='d' ", QUERY_CONTEXT_UNNEST, ImmutableList.of( Druids.newScanQueryBuilder() diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 4164973a3be8..791e5bf4bb79 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -1058,7 +1058,7 @@ public void testAnyAggregator() public void testAnyAggregatorsOnHeapNumericNulls() { testQuery( - "SELECT ANY_VALUE(l1), ANY_VALUE(dbl1), ANY_VALUE(f1) FROM druid.numfoo", + "SELECT ANY_VALUE(l1), ANY_VALUE(d1), ANY_VALUE(f1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1119,17 +1119,17 @@ public void testLatestVectorAggregatorsOnTimeExpression() public void testAnyAggregatorsOffHeapNumericNulls() { testQuery( - "SELECT ANY_VALUE(l1), ANY_VALUE(dbl1), ANY_VALUE(f1) FROM druid.numfoo GROUP BY dim2", + "SELECT ANY_VALUE(l1), ANY_VALUE(d1), ANY_VALUE(f1) FROM druid.numfoo GROUP BY dim2", ImmutableList.of( GroupByQuery.builder() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "_d0"))) .setAggregatorSpecs( aggregators( new LongAnyAggregatorFactory("a0", "l1"), - new DoubleAnyAggregatorFactory("a1", "dbl1"), + new DoubleAnyAggregatorFactory("a1", "d1"), new FloatAnyAggregatorFactory("a2", "f1") ) ) @@ -1246,7 +1246,7 @@ public void testStringLatestGroupBy() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "_d0"))) .setAggregatorSpecs(aggregators( new StringLastAggregatorFactory("a0", "dim4", null, 10) ) @@ -1712,7 +1712,7 @@ public void testStringAnyInSubquery() public void testEarliestAggregatorsNumericNulls() { testQuery( - "SELECT EARLIEST(l1), EARLIEST(dbl1), EARLIEST(f1) FROM druid.numfoo", + "SELECT EARLIEST(l1), EARLIEST(d1), EARLIEST(f1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1739,7 +1739,7 @@ public void testLatestAggregatorsNumericNull() { msqIncompatible(); testQuery( - "SELECT LATEST(l1), LATEST(dbl1), LATEST(f1) FROM druid.numfoo", + "SELECT LATEST(l1), LATEST(d1), LATEST(f1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1780,7 +1780,7 @@ public void testFirstLatestAggregatorsSkipNulls() ); } testQuery( - "SELECT EARLIEST(dim1, 32), LATEST(l1), LATEST(dbl1), LATEST(f1) " + "SELECT EARLIEST(dim1, 32), LATEST(l1), LATEST(d1), LATEST(f1) " + "FROM druid.numfoo " + "WHERE dim1 IS NOT NULL AND l1 IS NOT NULL AND d1 IS NOT NULL AND f1 is NOT NULL", ImmutableList.of( @@ -1907,7 +1907,7 @@ public void testOrderByEarliestFloat() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "d0")) + .dimension(new DefaultDimensionSpec("dim1", "_d0")) .aggregators( aggregators( new FloatFirstAggregatorFactory("a0", "f1", null) @@ -1946,13 +1946,13 @@ public void testOrderByEarliestDouble() ); } testQuery( - "SELECT dim1, EARLIEST(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", + "SELECT dim1, EARLIEST(d1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "d0")) + .dimension(new DefaultDimensionSpec("dim1", "_d0")) .aggregators( aggregators( new DoubleFirstAggregatorFactory("a0", "d1", null) @@ -1997,7 +1997,7 @@ public void testOrderByEarliestLong() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "d0")) + .dimension(new DefaultDimensionSpec("dim1", "_d0")) .aggregators( aggregators( new LongFirstAggregatorFactory("a0", "l1", null) @@ -2044,7 +2044,7 @@ public void testOrderByLatestFloat() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "d0")) + .dimension(new DefaultDimensionSpec("dim1", "_d0")) .aggregators( aggregators( new FloatLastAggregatorFactory("a0", "f1", null) @@ -2084,16 +2084,16 @@ public void testOrderByLatestDouble() ); } testQuery( - "SELECT dim1, LATEST(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", + "SELECT dim1, LATEST(d1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "d0")) + .dimension(new DefaultDimensionSpec("dim1", "_d0")) .aggregators( aggregators( - new DoubleLastAggregatorFactory("a0", "dbl1", null) + new DoubleLastAggregatorFactory("a0", "d1", null) ) ) .metric(new InvertedTopNMetricSpec(new NumericTopNMetricSpec("a0"))) @@ -2136,7 +2136,7 @@ public void testOrderByLatestLong() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "d0")) + .dimension(new DefaultDimensionSpec("dim1", "_d0")) .aggregators( aggregators( new LongLastAggregatorFactory("a0", "l1", null) @@ -2187,7 +2187,7 @@ public void testOrderByAnyFloat() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "d0")) + .dimension(new DefaultDimensionSpec("dim1", "_d0")) .aggregators( aggregators( new FloatAnyAggregatorFactory("a0", "f1") @@ -2231,13 +2231,13 @@ public void testOrderByAnyDouble() ); } testQuery( - "SELECT dim1, ANY_VALUE(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", + "SELECT dim1, ANY_VALUE(d1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "d0")) + .dimension(new DefaultDimensionSpec("dim1", "_d0")) .aggregators( aggregators( new DoubleAnyAggregatorFactory("a0", "d1") @@ -2287,7 +2287,7 @@ public void testOrderByAnyLong() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "d0")) + .dimension(new DefaultDimensionSpec("dim1", "_d0")) .aggregators( aggregators( new LongAnyAggregatorFactory("a0", "l1") @@ -2703,7 +2703,7 @@ public void testHavingOnExactCountDistinct() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING))) .setAggregatorSpecs( aggregators( useDefault @@ -3703,7 +3703,7 @@ public void testNullDoubleTopN() new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("d1", "d0", ColumnType.DOUBLE)) + .dimension(new DefaultDimensionSpec("d1", "_d0", ColumnType.DOUBLE)) .threshold(10) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .metric( @@ -3747,7 +3747,7 @@ public void testNullFloatTopN() new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("f1", "d0", ColumnType.FLOAT)) + .dimension(new DefaultDimensionSpec("f1", "_d0", ColumnType.FLOAT)) .threshold(10) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .metric( @@ -3791,7 +3791,7 @@ public void testNullLongTopN() new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("l1", "d0", ColumnType.LONG)) + .dimension(new DefaultDimensionSpec("l1", "_d0", ColumnType.LONG)) .threshold(10) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .metric( @@ -3873,7 +3873,7 @@ public void testDoublePredicateFilterNulls() testQuery( "SELECT COUNT(*)\n" + "FROM druid.numfoo\n" - + "WHERE dbl1 > 0", + + "WHERE d1 > 0", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -4907,7 +4907,7 @@ public void testSimpleLongAggregations() public void testSimpleDoubleAggregations() { testQuery( - "SELECT MIN(dbl1), MAX(dbl1) FROM druid.numfoo", + "SELECT MIN(d1), MAX(d1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -4953,7 +4953,7 @@ public void testSimpleFloatAggregations() public void testSimpleAggregations() { testQuery( - "SELECT COUNT(*), COUNT(cnt), COUNT(dim1), AVG(cnt), SUM(cnt), SUM(cnt) + MIN(cnt) + MAX(cnt), COUNT(dim2), COUNT(dbl1), AVG(dbl1) FROM druid.numfoo", + "SELECT COUNT(*), COUNT(cnt), COUNT(dim1), AVG(cnt), SUM(cnt), SUM(cnt) + MIN(cnt) + MAX(cnt), COUNT(dim2), COUNT(d1), AVG(d1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() @@ -7656,7 +7656,7 @@ public void testExactCountDistinctWithGroupingAndOtherAggregators() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0"))) .setAggregatorSpecs(aggregators( new LongSumAggregatorFactory("_a0", "a0"), new FilteredAggregatorFactory( @@ -7726,7 +7726,7 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo ) .setGranularity(Granularities.ALL) .setInterval(querySegmentSpec(Filtration.eternity())) - .setDimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING)) .setAggregatorSpecs( new FilteredAggregatorFactory( new CountAggregatorFactory("a0"), @@ -7757,7 +7757,7 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo ) ) .setInterval(querySegmentSpec(Filtration.eternity())) - .setDimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING)) .setAggregatorSpecs( NullHandling.sqlCompatible() ? new FilteredAggregatorFactory( @@ -7898,7 +7898,7 @@ public void testMultipleExactCountDistinctWithGroupingUsingGroupingSets() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.LONG))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.LONG))) .setAggregatorSpecs(aggregators( new FilteredAggregatorFactory( new CountAggregatorFactory("_a0"), @@ -8086,8 +8086,8 @@ public void testNestedGroupBy() ) ) .setDimensions(dimensions( - new DefaultDimensionSpec("v0", "d0", ColumnType.LONG), - new DefaultDimensionSpec("d0", "d1", ColumnType.STRING) + new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG), + new DefaultDimensionSpec("d0", "_d1", ColumnType.STRING) )) .setAggregatorSpecs( aggregators( @@ -8143,7 +8143,7 @@ public void testDoubleNestedGroupBy() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d1", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("d1", "_d0"))) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("_a0", "a0"))) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -8200,7 +8200,7 @@ public void testDoubleNestedGroupBy2() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("d1", "d0")) + .setDimensions(new DefaultDimensionSpec("d1", "_d0")) .setAggregatorSpecs(new LongMaxAggregatorFactory("_a0", "a0")) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -8539,7 +8539,7 @@ public void testHistogramUsingSubquery() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("a0", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("a0", "_d0"))) .setAggregatorSpecs(aggregators( new CountAggregatorFactory("_a0") )) @@ -8584,14 +8584,14 @@ public void testHistogramUsingSubqueryWithSort() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("a0", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("a0", "_d0"))) .setAggregatorSpecs(aggregators( new CountAggregatorFactory("_a0") )) .setLimitSpec( new DefaultLimitSpec( ImmutableList.of(new OrderByColumnSpec( - "d0", + "_d0", OrderByColumnSpec.Direction.ASCENDING, StringComparators.LEXICOGRAPHIC )), @@ -9038,8 +9038,8 @@ public void testGroupByLimitPushdownExtraction() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "d0"), - new ExtractionDimensionSpec("dim5", "d1", new SubstringDimExtractionFn(0, 1)) + new DefaultDimensionSpec("v0", "_d0"), + new ExtractionDimensionSpec("dim5", "_d1", new SubstringDimExtractionFn(0, 1)) ) ) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) @@ -10367,14 +10367,14 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValues() + " count(*),\n" + " COUNT(DISTINCT dim1),\n" + " APPROX_COUNT_DISTINCT(distinct dim1),\n" - + " sum(dbl1),\n" - + " max(dbl1),\n" - + " min(dbl1),\n" + + " sum(d1),\n" + + " max(d1),\n" + + " min(d1),\n" + " sum(l1),\n" + " max(l1),\n" + " min(l1),\n" + " avg(l1),\n" - + " avg(dbl1)\n" + + " avg(d1)\n" + "FROM druid.numfoo WHERE dim2 = 0", ImmutableList.of( Druids.newTimeseriesQueryBuilder() @@ -10634,14 +10634,14 @@ public void testGroupByAggregatorDefaultValues() + " count(*) FILTER(WHERE dim1 = 'nonexistent'),\n" + " COUNT(DISTINCT dim1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " APPROX_COUNT_DISTINCT(distinct dim1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " sum(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " max(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " min(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + " sum(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + " max(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + " min(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " sum(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " max(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " min(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " avg(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " avg(dbl1) FILTER(WHERE dim1 = 'nonexistent')\n" + + " avg(d1) FILTER(WHERE dim1 = 'nonexistent')\n" + "FROM druid.numfoo WHERE dim2 = 'a' GROUP BY dim2", ImmutableList.of( GroupByQuery.builder() @@ -10650,7 +10650,7 @@ public void testGroupByAggregatorDefaultValues() .setDimFilter(equality("dim2", "a", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) - .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -10807,7 +10807,7 @@ public void testGroupByAggregatorDefaultValuesNonVectorized() .setDimFilter(equality("dim2", "a", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) - .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -11458,17 +11458,17 @@ public void testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("d1", "d0"), - new DefaultDimensionSpec("p0", "d1", ColumnType.LONG) + new DefaultDimensionSpec("d1", "_d0"), + new DefaultDimensionSpec("p0", "_d1", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new DoubleSumAggregatorFactory("_a0", "a0"))) .setLimitSpec( new DefaultLimitSpec( ImmutableList.of( - new OrderByColumnSpec("d0", OrderByColumnSpec.Direction.ASCENDING), + new OrderByColumnSpec("_d0", OrderByColumnSpec.Direction.ASCENDING), new OrderByColumnSpec( - "d1", + "_d1", Direction.DESCENDING, StringComparators.NUMERIC ) @@ -12521,8 +12521,8 @@ public void testSortProjectAfterNestedGroupBy() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("d0", "d0", ColumnType.LONG), - new DefaultDimensionSpec("d1", "d1", ColumnType.STRING) + new DefaultDimensionSpec("d0", "_d0", ColumnType.LONG), + new DefaultDimensionSpec("d1", "_d1", ColumnType.STRING) ) ) .setAggregatorSpecs( @@ -13536,7 +13536,7 @@ public void testGroupByWithLiteralInSubqueryGrouping() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("dim4", "d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("dim4", "_d0", ColumnType.STRING)) .setContext(QUERY_CONTEXT_DEFAULT) .build() ) @@ -13548,15 +13548,15 @@ public void testGroupByWithLiteralInSubqueryGrouping() ), expressionVirtualColumn( "v1", - "case_searched((\"d0\" == 'b'),\"d0\",null)", + "case_searched((\"_d0\" == 'b'),\"_d0\",null)", ColumnType.STRING ) ) .setInterval(querySegmentSpec(Filtration.eternity())) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING), - new DefaultDimensionSpec("v1", "_d1", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING), + new DefaultDimensionSpec("v1", "d1", ColumnType.STRING) ) ) .setGranularity(Granularities.ALL) @@ -14129,7 +14129,7 @@ public void testCountAndAverageByConstantVirtualColumn() ) .setGranularity(Granularities.ALL) .setVirtualColumns(VirtualColumns.create(virtualColumns)) - .setDimensions(new DefaultDimensionSpec("dim5", "d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("dim5", "_d0", ColumnType.STRING)) .setAggregatorSpecs(aggs) .setPostAggregatorSpecs( ImmutableList.of( @@ -14304,7 +14304,7 @@ public void testBitwiseAggregatorsGroupBy() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("dim2", "d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("dim2", "_d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -14551,7 +14551,7 @@ public void testStringAggNumeric() { cannotVectorize(); testQuery( - "SELECT STRING_AGG(l1, ','), STRING_AGG(DISTINCT l1, ','), STRING_AGG(dbl1, ','), STRING_AGG(DISTINCT d1, ','), STRING_AGG(f1, ','), STRING_AGG(DISTINCT f1, ',') FROM numfoo", + "SELECT STRING_AGG(l1, ','), STRING_AGG(DISTINCT l1, ','), STRING_AGG(d1, ','), STRING_AGG(DISTINCT d1, ','), STRING_AGG(f1, ','), STRING_AGG(DISTINCT f1, ',') FROM numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -15173,7 +15173,7 @@ public void testGreatestFunctionForNumberWithIsNull() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Intervals.ETERNITY)) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "d0")) + .addDimension(new DefaultDimensionSpec("dim1", "_d0")) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "0", ColumnType.LONG) )) @@ -15200,7 +15200,7 @@ public void testGreatestFunctionForNumberWithIsNull() ) ) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "d0")) + .addDimension(new DefaultDimensionSpec("dim1", "_d0")) .addAggregator(new LongMaxAggregatorFactory("a0", "v0")) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "isnull(\"a0\")", ColumnType.LONG) @@ -15238,7 +15238,7 @@ public void testGreatestFunctionForStringWithIsNull() ) ) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("l1", "d0", ColumnType.LONG)) + .addDimension(new DefaultDimensionSpec("l1", "_d0", ColumnType.LONG)) .addAggregator(new StringLastAggregatorFactory("a0", "v0", null, 1024)) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "isnull(\"a0\")", ColumnType.LONG) @@ -15280,7 +15280,7 @@ public void testSubqueryTypeMismatchWithLiterals() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Intervals.ETERNITY)) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "d0", ColumnType.STRING)) + .addDimension(new DefaultDimensionSpec("dim1", "_d0", ColumnType.STRING)) .addAggregator(new LongSumAggregatorFactory("a0", "l1")) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "case_searched((\"a0\" == 0),1,0)", ColumnType.LONG))) @@ -16273,8 +16273,8 @@ public void testLatestByAggregatorOnSecondaryTimestampGroupBy() .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) .setDimensions( - new DefaultDimensionSpec("__time", "d0", ColumnType.LONG), - new DefaultDimensionSpec("m1", "d1", ColumnType.FLOAT) + new DefaultDimensionSpec("__time", "_d0", ColumnType.LONG), + new DefaultDimensionSpec("m1", "_d1", ColumnType.FLOAT) ) .setAggregatorSpecs(aggregators(new FloatLastAggregatorFactory("a0", "m1", "m2"))) .setContext(OUTER_LIMIT_CONTEXT) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java index 63640a1deb62..046ff4b48110 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java @@ -115,9 +115,6 @@ */ public class TestDataBuilder { - private static final String D1 = "dbl1"; - private static final String D2 = "dbl2"; - private static final ObjectMapper MAPPER = new DefaultObjectMapper(); public static final String TIMESTAMP_COLUMN = "t"; @@ -174,8 +171,8 @@ public Optional build( "dim5", "dim6" ))) - .add(new DoubleDimensionSchema(D1)) - .add(new DoubleDimensionSchema(D2)) + .add(new DoubleDimensionSchema("d1")) + .add(new DoubleDimensionSchema("d2")) .add(new FloatDimensionSchema("f1")) .add(new FloatDimensionSchema("f2")) .add(new LongDimensionSchema("l1")) @@ -393,7 +390,7 @@ public Optional build( .put("t", "2000-01-01") .put("m1", "1.0") .put("m2", "1.0") - .put(D1, 1.0) + .put("d1", 1.0) .put("f1", 1.0f) .put("l1", 7L) .put("dim1", "") @@ -407,8 +404,8 @@ public Optional build( .put("t", "2000-01-02") .put("m1", "2.0") .put("m2", "2.0") - .put(D1, 1.7) - .put(D2, 1.7) + .put("d1", 1.7) + .put("d2", 1.7) .put("f1", 0.1f) .put("f2", 0.1f) .put("l1", 325323L) @@ -424,8 +421,8 @@ public Optional build( .put("t", "2000-01-03") .put("m1", "3.0") .put("m2", "3.0") - .put(D1, 0.0) - .put(D2, 0.0) + .put("d1", 0.0) + .put("d2", 0.0) .put("f1", 0.0) .put("f2", 0.0) .put("l1", 0) @@ -597,8 +594,8 @@ public Optional build( x.get("dim3"), x.get("dim4"), x.get("dim5"), - x.get(D1), - x.get(D2), + x.get("d1"), + x.get("d2"), x.get("f1"), x.get("f2"), x.get("l1"), @@ -610,8 +607,8 @@ public Optional build( .add("dim3", ColumnType.STRING) .add("dim4", ColumnType.STRING) .add("dim5", ColumnType.STRING) - .add(D1, ColumnType.DOUBLE) - .add(D2, ColumnType.DOUBLE) + .add("d1", ColumnType.DOUBLE) + .add("d2", ColumnType.DOUBLE) .add("f1", ColumnType.FLOAT) .add("f2", ColumnType.FLOAT) .add("l1", ColumnType.LONG) From d4b4c94a3c7cb20fa43adae1ccd29230b33c318b Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 12 Nov 2024 15:04:41 +0000 Subject: [PATCH 15/99] Reapply "rename: d1/dbl1" This reverts commit 0d03cc558781cfd4093c0ff7c87f03c7cc65e027. --- .../sql/calcite/CalciteArraysQueryTest.java | 2 +- .../druid/sql/calcite/CalciteQueryTest.java | 140 +++++++++--------- .../sql/calcite/util/TestDataBuilder.java | 25 ++-- 3 files changed, 85 insertions(+), 82 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index f2ef6941fc35..0e8faad878e0 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -5895,7 +5895,7 @@ public void testUnnestWithInvalidINFiltersOnUnnestedColumn() public void testUnnestWithNotFiltersOnUnnestedColumn() { testQuery( - "SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3!='d' ", + "SELECT d3,MV_TO_ARRAY(dim3) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3!='d' ", QUERY_CONTEXT_UNNEST, ImmutableList.of( Druids.newScanQueryBuilder() diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 791e5bf4bb79..4164973a3be8 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -1058,7 +1058,7 @@ public void testAnyAggregator() public void testAnyAggregatorsOnHeapNumericNulls() { testQuery( - "SELECT ANY_VALUE(l1), ANY_VALUE(d1), ANY_VALUE(f1) FROM druid.numfoo", + "SELECT ANY_VALUE(l1), ANY_VALUE(dbl1), ANY_VALUE(f1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1119,17 +1119,17 @@ public void testLatestVectorAggregatorsOnTimeExpression() public void testAnyAggregatorsOffHeapNumericNulls() { testQuery( - "SELECT ANY_VALUE(l1), ANY_VALUE(d1), ANY_VALUE(f1) FROM druid.numfoo GROUP BY dim2", + "SELECT ANY_VALUE(l1), ANY_VALUE(dbl1), ANY_VALUE(f1) FROM druid.numfoo GROUP BY dim2", ImmutableList.of( GroupByQuery.builder() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "d0"))) .setAggregatorSpecs( aggregators( new LongAnyAggregatorFactory("a0", "l1"), - new DoubleAnyAggregatorFactory("a1", "d1"), + new DoubleAnyAggregatorFactory("a1", "dbl1"), new FloatAnyAggregatorFactory("a2", "f1") ) ) @@ -1246,7 +1246,7 @@ public void testStringLatestGroupBy() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "d0"))) .setAggregatorSpecs(aggregators( new StringLastAggregatorFactory("a0", "dim4", null, 10) ) @@ -1712,7 +1712,7 @@ public void testStringAnyInSubquery() public void testEarliestAggregatorsNumericNulls() { testQuery( - "SELECT EARLIEST(l1), EARLIEST(d1), EARLIEST(f1) FROM druid.numfoo", + "SELECT EARLIEST(l1), EARLIEST(dbl1), EARLIEST(f1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1739,7 +1739,7 @@ public void testLatestAggregatorsNumericNull() { msqIncompatible(); testQuery( - "SELECT LATEST(l1), LATEST(d1), LATEST(f1) FROM druid.numfoo", + "SELECT LATEST(l1), LATEST(dbl1), LATEST(f1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1780,7 +1780,7 @@ public void testFirstLatestAggregatorsSkipNulls() ); } testQuery( - "SELECT EARLIEST(dim1, 32), LATEST(l1), LATEST(d1), LATEST(f1) " + "SELECT EARLIEST(dim1, 32), LATEST(l1), LATEST(dbl1), LATEST(f1) " + "FROM druid.numfoo " + "WHERE dim1 IS NOT NULL AND l1 IS NOT NULL AND d1 IS NOT NULL AND f1 is NOT NULL", ImmutableList.of( @@ -1907,7 +1907,7 @@ public void testOrderByEarliestFloat() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new FloatFirstAggregatorFactory("a0", "f1", null) @@ -1946,13 +1946,13 @@ public void testOrderByEarliestDouble() ); } testQuery( - "SELECT dim1, EARLIEST(d1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", + "SELECT dim1, EARLIEST(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new DoubleFirstAggregatorFactory("a0", "d1", null) @@ -1997,7 +1997,7 @@ public void testOrderByEarliestLong() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new LongFirstAggregatorFactory("a0", "l1", null) @@ -2044,7 +2044,7 @@ public void testOrderByLatestFloat() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new FloatLastAggregatorFactory("a0", "f1", null) @@ -2084,16 +2084,16 @@ public void testOrderByLatestDouble() ); } testQuery( - "SELECT dim1, LATEST(d1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", + "SELECT dim1, LATEST(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( - new DoubleLastAggregatorFactory("a0", "d1", null) + new DoubleLastAggregatorFactory("a0", "dbl1", null) ) ) .metric(new InvertedTopNMetricSpec(new NumericTopNMetricSpec("a0"))) @@ -2136,7 +2136,7 @@ public void testOrderByLatestLong() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new LongLastAggregatorFactory("a0", "l1", null) @@ -2187,7 +2187,7 @@ public void testOrderByAnyFloat() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new FloatAnyAggregatorFactory("a0", "f1") @@ -2231,13 +2231,13 @@ public void testOrderByAnyDouble() ); } testQuery( - "SELECT dim1, ANY_VALUE(d1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", + "SELECT dim1, ANY_VALUE(dbl1) FROM druid.numfoo GROUP BY 1 ORDER BY 2 LIMIT 10", ImmutableList.of( new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new DoubleAnyAggregatorFactory("a0", "d1") @@ -2287,7 +2287,7 @@ public void testOrderByAnyLong() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim1", "_d0")) + .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( new LongAnyAggregatorFactory("a0", "l1") @@ -2703,7 +2703,7 @@ public void testHavingOnExactCountDistinct() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING))) .setAggregatorSpecs( aggregators( useDefault @@ -3703,7 +3703,7 @@ public void testNullDoubleTopN() new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("d1", "_d0", ColumnType.DOUBLE)) + .dimension(new DefaultDimensionSpec("d1", "d0", ColumnType.DOUBLE)) .threshold(10) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .metric( @@ -3747,7 +3747,7 @@ public void testNullFloatTopN() new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("f1", "_d0", ColumnType.FLOAT)) + .dimension(new DefaultDimensionSpec("f1", "d0", ColumnType.FLOAT)) .threshold(10) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .metric( @@ -3791,7 +3791,7 @@ public void testNullLongTopN() new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("l1", "_d0", ColumnType.LONG)) + .dimension(new DefaultDimensionSpec("l1", "d0", ColumnType.LONG)) .threshold(10) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .metric( @@ -3873,7 +3873,7 @@ public void testDoublePredicateFilterNulls() testQuery( "SELECT COUNT(*)\n" + "FROM druid.numfoo\n" - + "WHERE d1 > 0", + + "WHERE dbl1 > 0", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -4907,7 +4907,7 @@ public void testSimpleLongAggregations() public void testSimpleDoubleAggregations() { testQuery( - "SELECT MIN(d1), MAX(d1) FROM druid.numfoo", + "SELECT MIN(dbl1), MAX(dbl1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -4953,7 +4953,7 @@ public void testSimpleFloatAggregations() public void testSimpleAggregations() { testQuery( - "SELECT COUNT(*), COUNT(cnt), COUNT(dim1), AVG(cnt), SUM(cnt), SUM(cnt) + MIN(cnt) + MAX(cnt), COUNT(dim2), COUNT(d1), AVG(d1) FROM druid.numfoo", + "SELECT COUNT(*), COUNT(cnt), COUNT(dim1), AVG(cnt), SUM(cnt), SUM(cnt) + MIN(cnt) + MAX(cnt), COUNT(dim2), COUNT(dbl1), AVG(dbl1) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() @@ -7656,7 +7656,7 @@ public void testExactCountDistinctWithGroupingAndOtherAggregators() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0"))) .setAggregatorSpecs(aggregators( new LongSumAggregatorFactory("_a0", "a0"), new FilteredAggregatorFactory( @@ -7726,7 +7726,7 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo ) .setGranularity(Granularities.ALL) .setInterval(querySegmentSpec(Filtration.eternity())) - .setDimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING)) .setAggregatorSpecs( new FilteredAggregatorFactory( new CountAggregatorFactory("a0"), @@ -7757,7 +7757,7 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo ) ) .setInterval(querySegmentSpec(Filtration.eternity())) - .setDimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING)) .setAggregatorSpecs( NullHandling.sqlCompatible() ? new FilteredAggregatorFactory( @@ -7898,7 +7898,7 @@ public void testMultipleExactCountDistinctWithGroupingUsingGroupingSets() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.LONG))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.LONG))) .setAggregatorSpecs(aggregators( new FilteredAggregatorFactory( new CountAggregatorFactory("_a0"), @@ -8086,8 +8086,8 @@ public void testNestedGroupBy() ) ) .setDimensions(dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG), - new DefaultDimensionSpec("d0", "_d1", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.LONG), + new DefaultDimensionSpec("d0", "d1", ColumnType.STRING) )) .setAggregatorSpecs( aggregators( @@ -8143,7 +8143,7 @@ public void testDoubleNestedGroupBy() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d1", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("d1", "d0"))) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("_a0", "a0"))) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -8200,7 +8200,7 @@ public void testDoubleNestedGroupBy2() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("d1", "_d0")) + .setDimensions(new DefaultDimensionSpec("d1", "d0")) .setAggregatorSpecs(new LongMaxAggregatorFactory("_a0", "a0")) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -8539,7 +8539,7 @@ public void testHistogramUsingSubquery() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("a0", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("a0", "d0"))) .setAggregatorSpecs(aggregators( new CountAggregatorFactory("_a0") )) @@ -8584,14 +8584,14 @@ public void testHistogramUsingSubqueryWithSort() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("a0", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("a0", "d0"))) .setAggregatorSpecs(aggregators( new CountAggregatorFactory("_a0") )) .setLimitSpec( new DefaultLimitSpec( ImmutableList.of(new OrderByColumnSpec( - "_d0", + "d0", OrderByColumnSpec.Direction.ASCENDING, StringComparators.LEXICOGRAPHIC )), @@ -9038,8 +9038,8 @@ public void testGroupByLimitPushdownExtraction() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0"), - new ExtractionDimensionSpec("dim5", "_d1", new SubstringDimExtractionFn(0, 1)) + new DefaultDimensionSpec("v0", "d0"), + new ExtractionDimensionSpec("dim5", "d1", new SubstringDimExtractionFn(0, 1)) ) ) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) @@ -10367,14 +10367,14 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValues() + " count(*),\n" + " COUNT(DISTINCT dim1),\n" + " APPROX_COUNT_DISTINCT(distinct dim1),\n" - + " sum(d1),\n" - + " max(d1),\n" - + " min(d1),\n" + + " sum(dbl1),\n" + + " max(dbl1),\n" + + " min(dbl1),\n" + " sum(l1),\n" + " max(l1),\n" + " min(l1),\n" + " avg(l1),\n" - + " avg(d1)\n" + + " avg(dbl1)\n" + "FROM druid.numfoo WHERE dim2 = 0", ImmutableList.of( Druids.newTimeseriesQueryBuilder() @@ -10634,14 +10634,14 @@ public void testGroupByAggregatorDefaultValues() + " count(*) FILTER(WHERE dim1 = 'nonexistent'),\n" + " COUNT(DISTINCT dim1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " APPROX_COUNT_DISTINCT(distinct dim1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " sum(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " max(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " min(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + " sum(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + " max(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + " min(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " sum(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " max(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " min(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + " avg(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + " avg(d1) FILTER(WHERE dim1 = 'nonexistent')\n" + + " avg(dbl1) FILTER(WHERE dim1 = 'nonexistent')\n" + "FROM druid.numfoo WHERE dim2 = 'a' GROUP BY dim2", ImmutableList.of( GroupByQuery.builder() @@ -10650,7 +10650,7 @@ public void testGroupByAggregatorDefaultValues() .setDimFilter(equality("dim2", "a", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) - .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -10807,7 +10807,7 @@ public void testGroupByAggregatorDefaultValuesNonVectorized() .setDimFilter(equality("dim2", "a", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) - .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -11458,17 +11458,17 @@ public void testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("d1", "_d0"), - new DefaultDimensionSpec("p0", "_d1", ColumnType.LONG) + new DefaultDimensionSpec("d1", "d0"), + new DefaultDimensionSpec("p0", "d1", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new DoubleSumAggregatorFactory("_a0", "a0"))) .setLimitSpec( new DefaultLimitSpec( ImmutableList.of( - new OrderByColumnSpec("_d0", OrderByColumnSpec.Direction.ASCENDING), + new OrderByColumnSpec("d0", OrderByColumnSpec.Direction.ASCENDING), new OrderByColumnSpec( - "_d1", + "d1", Direction.DESCENDING, StringComparators.NUMERIC ) @@ -12521,8 +12521,8 @@ public void testSortProjectAfterNestedGroupBy() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("d0", "_d0", ColumnType.LONG), - new DefaultDimensionSpec("d1", "_d1", ColumnType.STRING) + new DefaultDimensionSpec("d0", "d0", ColumnType.LONG), + new DefaultDimensionSpec("d1", "d1", ColumnType.STRING) ) ) .setAggregatorSpecs( @@ -13536,7 +13536,7 @@ public void testGroupByWithLiteralInSubqueryGrouping() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("dim4", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("dim4", "d0", ColumnType.STRING)) .setContext(QUERY_CONTEXT_DEFAULT) .build() ) @@ -13548,15 +13548,15 @@ public void testGroupByWithLiteralInSubqueryGrouping() ), expressionVirtualColumn( "v1", - "case_searched((\"_d0\" == 'b'),\"_d0\",null)", + "case_searched((\"d0\" == 'b'),\"d0\",null)", ColumnType.STRING ) ) .setInterval(querySegmentSpec(Filtration.eternity())) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "d0", ColumnType.STRING), - new DefaultDimensionSpec("v1", "d1", ColumnType.STRING) + new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING), + new DefaultDimensionSpec("v1", "_d1", ColumnType.STRING) ) ) .setGranularity(Granularities.ALL) @@ -14129,7 +14129,7 @@ public void testCountAndAverageByConstantVirtualColumn() ) .setGranularity(Granularities.ALL) .setVirtualColumns(VirtualColumns.create(virtualColumns)) - .setDimensions(new DefaultDimensionSpec("dim5", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("dim5", "d0", ColumnType.STRING)) .setAggregatorSpecs(aggs) .setPostAggregatorSpecs( ImmutableList.of( @@ -14304,7 +14304,7 @@ public void testBitwiseAggregatorsGroupBy() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("dim2", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("dim2", "d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -14551,7 +14551,7 @@ public void testStringAggNumeric() { cannotVectorize(); testQuery( - "SELECT STRING_AGG(l1, ','), STRING_AGG(DISTINCT l1, ','), STRING_AGG(d1, ','), STRING_AGG(DISTINCT d1, ','), STRING_AGG(f1, ','), STRING_AGG(DISTINCT f1, ',') FROM numfoo", + "SELECT STRING_AGG(l1, ','), STRING_AGG(DISTINCT l1, ','), STRING_AGG(dbl1, ','), STRING_AGG(DISTINCT d1, ','), STRING_AGG(f1, ','), STRING_AGG(DISTINCT f1, ',') FROM numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -15173,7 +15173,7 @@ public void testGreatestFunctionForNumberWithIsNull() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Intervals.ETERNITY)) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "_d0")) + .addDimension(new DefaultDimensionSpec("dim1", "d0")) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "0", ColumnType.LONG) )) @@ -15200,7 +15200,7 @@ public void testGreatestFunctionForNumberWithIsNull() ) ) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "_d0")) + .addDimension(new DefaultDimensionSpec("dim1", "d0")) .addAggregator(new LongMaxAggregatorFactory("a0", "v0")) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "isnull(\"a0\")", ColumnType.LONG) @@ -15238,7 +15238,7 @@ public void testGreatestFunctionForStringWithIsNull() ) ) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("l1", "_d0", ColumnType.LONG)) + .addDimension(new DefaultDimensionSpec("l1", "d0", ColumnType.LONG)) .addAggregator(new StringLastAggregatorFactory("a0", "v0", null, 1024)) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "isnull(\"a0\")", ColumnType.LONG) @@ -15280,7 +15280,7 @@ public void testSubqueryTypeMismatchWithLiterals() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Intervals.ETERNITY)) .setGranularity(Granularities.ALL) - .addDimension(new DefaultDimensionSpec("dim1", "_d0", ColumnType.STRING)) + .addDimension(new DefaultDimensionSpec("dim1", "d0", ColumnType.STRING)) .addAggregator(new LongSumAggregatorFactory("a0", "l1")) .setPostAggregatorSpecs(ImmutableList.of( expressionPostAgg("p0", "case_searched((\"a0\" == 0),1,0)", ColumnType.LONG))) @@ -16273,8 +16273,8 @@ public void testLatestByAggregatorOnSecondaryTimestampGroupBy() .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) .setDimensions( - new DefaultDimensionSpec("__time", "_d0", ColumnType.LONG), - new DefaultDimensionSpec("m1", "_d1", ColumnType.FLOAT) + new DefaultDimensionSpec("__time", "d0", ColumnType.LONG), + new DefaultDimensionSpec("m1", "d1", ColumnType.FLOAT) ) .setAggregatorSpecs(aggregators(new FloatLastAggregatorFactory("a0", "m1", "m2"))) .setContext(OUTER_LIMIT_CONTEXT) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java index 046ff4b48110..63640a1deb62 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java @@ -115,6 +115,9 @@ */ public class TestDataBuilder { + private static final String D1 = "dbl1"; + private static final String D2 = "dbl2"; + private static final ObjectMapper MAPPER = new DefaultObjectMapper(); public static final String TIMESTAMP_COLUMN = "t"; @@ -171,8 +174,8 @@ public Optional build( "dim5", "dim6" ))) - .add(new DoubleDimensionSchema("d1")) - .add(new DoubleDimensionSchema("d2")) + .add(new DoubleDimensionSchema(D1)) + .add(new DoubleDimensionSchema(D2)) .add(new FloatDimensionSchema("f1")) .add(new FloatDimensionSchema("f2")) .add(new LongDimensionSchema("l1")) @@ -390,7 +393,7 @@ public Optional build( .put("t", "2000-01-01") .put("m1", "1.0") .put("m2", "1.0") - .put("d1", 1.0) + .put(D1, 1.0) .put("f1", 1.0f) .put("l1", 7L) .put("dim1", "") @@ -404,8 +407,8 @@ public Optional build( .put("t", "2000-01-02") .put("m1", "2.0") .put("m2", "2.0") - .put("d1", 1.7) - .put("d2", 1.7) + .put(D1, 1.7) + .put(D2, 1.7) .put("f1", 0.1f) .put("f2", 0.1f) .put("l1", 325323L) @@ -421,8 +424,8 @@ public Optional build( .put("t", "2000-01-03") .put("m1", "3.0") .put("m2", "3.0") - .put("d1", 0.0) - .put("d2", 0.0) + .put(D1, 0.0) + .put(D2, 0.0) .put("f1", 0.0) .put("f2", 0.0) .put("l1", 0) @@ -594,8 +597,8 @@ public Optional build( x.get("dim3"), x.get("dim4"), x.get("dim5"), - x.get("d1"), - x.get("d2"), + x.get(D1), + x.get(D2), x.get("f1"), x.get("f2"), x.get("l1"), @@ -607,8 +610,8 @@ public Optional build( .add("dim3", ColumnType.STRING) .add("dim4", ColumnType.STRING) .add("dim5", ColumnType.STRING) - .add("d1", ColumnType.DOUBLE) - .add("d2", ColumnType.DOUBLE) + .add(D1, ColumnType.DOUBLE) + .add(D2, ColumnType.DOUBLE) .add("f1", ColumnType.FLOAT) .add("f2", ColumnType.FLOAT) .add("l1", ColumnType.LONG) From 7777e48b77e09bdce5e2ab9a5612ddf168ff482d Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 13:11:10 +0000 Subject: [PATCH 16/99] dbl1/etc --- .../druid/sql/calcite/CalciteQueryTest.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 4164973a3be8..57660ebc9a91 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -3505,7 +3505,7 @@ public void testNullDoubleFilter() testQuery( "SELECT COUNT(*)\n" + "FROM druid.numfoo\n" - + "WHERE d1 IS NULL", + + "WHERE dbl1 IS NULL", useDefault ? ImmutableList.of( Druids.newScanQueryBuilder() @@ -3525,7 +3525,7 @@ public void testNullDoubleFilter() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .filters(isNull("d1")) + .filters(isNull("dbl1")) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(QUERY_CONTEXT_DEFAULT) .build() @@ -4977,7 +4977,7 @@ public void testSimpleAggregations() new CountAggregatorFactory("a6"), notNull("dim2") ), - new DoubleSumAggregatorFactory("a7:sum", "d1"), + new DoubleSumAggregatorFactory("a7:sum", "dbl1"), new CountAggregatorFactory("a7:count") ) : aggregators( @@ -5006,10 +5006,10 @@ public void testSimpleAggregations() new CountAggregatorFactory("a8"), notNull("d1") ), - new DoubleSumAggregatorFactory("a9:sum", "d1"), + new DoubleSumAggregatorFactory("a9:sum", "dbl1"), new FilteredAggregatorFactory( new CountAggregatorFactory("a9:count"), - notNull("d1") + notNull("dbl1") ) ) ) @@ -8200,7 +8200,7 @@ public void testDoubleNestedGroupBy2() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("d1", "d0")) + .setDimensions(new DefaultDimensionSpec("d1", "_d0")) .setAggregatorSpecs(new LongMaxAggregatorFactory("_a0", "a0")) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -8576,7 +8576,7 @@ public void testHistogramUsingSubqueryWithSort() .setDataSource(CalciteTests.DATASOURCE1) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "_d0"))) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -10400,9 +10400,9 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValues() false, true ), - new DoubleSumAggregatorFactory("a3", "d1"), - new DoubleMaxAggregatorFactory("a4", "d1"), - new DoubleMinAggregatorFactory("a5", "d1"), + new DoubleSumAggregatorFactory("a3", "dbl1"), + new DoubleMaxAggregatorFactory("a4", "dbl1"), + new DoubleMinAggregatorFactory("a5", "dbl1"), new LongSumAggregatorFactory("a6", "l1"), new LongMaxAggregatorFactory("a7", "l1"), new LongMinAggregatorFactory("a8", "l1"), @@ -10413,12 +10413,12 @@ public void testTimeseriesEmptyResultsAggregatorDefaultValues() new CountAggregatorFactory("a9:count"), notNull("l1") ), - new DoubleSumAggregatorFactory("a10:sum", "d1"), + new DoubleSumAggregatorFactory("a10:sum", "dbl1"), useDefault ? new CountAggregatorFactory("a10:count") : new FilteredAggregatorFactory( new CountAggregatorFactory("a10:count"), - notNull("d1") + notNull("dbl1") ) ) ) @@ -12521,8 +12521,8 @@ public void testSortProjectAfterNestedGroupBy() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("d0", "d0", ColumnType.LONG), - new DefaultDimensionSpec("d1", "d1", ColumnType.STRING) + new DefaultDimensionSpec("d0", "_d0", ColumnType.LONG), + new DefaultDimensionSpec("d1", "_d1", ColumnType.STRING) ) ) .setAggregatorSpecs( @@ -14551,7 +14551,7 @@ public void testStringAggNumeric() { cannotVectorize(); testQuery( - "SELECT STRING_AGG(l1, ','), STRING_AGG(DISTINCT l1, ','), STRING_AGG(dbl1, ','), STRING_AGG(DISTINCT d1, ','), STRING_AGG(f1, ','), STRING_AGG(DISTINCT f1, ',') FROM numfoo", + "SELECT STRING_AGG(l1, ','), STRING_AGG(DISTINCT l1, ','), STRING_AGG(dbl1, ','), STRING_AGG(DISTINCT dbl1, ','), STRING_AGG(f1, ','), STRING_AGG(DISTINCT f1, ',') FROM numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -14600,40 +14600,40 @@ public void testStringAggNumeric() new FilteredAggregatorFactory( new ExpressionLambdaAggregatorFactory( "a2", - ImmutableSet.of("d1"), + ImmutableSet.of("dbl1"), "__acc", "[]", "[]", true, false, false, - "array_append(\"__acc\", \"d1\")", + "array_append(\"__acc\", \"dbl1\")", "array_concat(\"__acc\", \"a2\")", null, "if(array_length(o) == 0, null, array_to_string(o, ','))", ExpressionLambdaAggregatorFactory.DEFAULT_MAX_SIZE_BYTES, TestExprMacroTable.INSTANCE ), - notNull("d1") + notNull("dbl1") ), new FilteredAggregatorFactory( new ExpressionLambdaAggregatorFactory( "a3", - ImmutableSet.of("d1"), + ImmutableSet.of("dbl1"), "__acc", "[]", "[]", true, false, false, - "array_set_add(\"__acc\", \"d1\")", + "array_set_add(\"__acc\", \"dbl1\")", "array_set_add_all(\"__acc\", \"a3\")", null, "if(array_length(o) == 0, null, array_to_string(o, ','))", ExpressionLambdaAggregatorFactory.DEFAULT_MAX_SIZE_BYTES, TestExprMacroTable.INSTANCE ), - notNull("d1") + notNull("dbl1") ), new FilteredAggregatorFactory( new ExpressionLambdaAggregatorFactory( From 0d07cf137e0250d978c2a07bd55284feca2fab26 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 13:55:38 +0000 Subject: [PATCH 17/99] dbl1/etc --- .../druid/sql/calcite/CalciteQueryTest.java | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 57660ebc9a91..9a4a48b7233f 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -1067,7 +1067,7 @@ public void testAnyAggregatorsOnHeapNumericNulls() .aggregators( aggregators( new LongAnyAggregatorFactory("a0", "l1"), - new DoubleAnyAggregatorFactory("a1", "d1"), + new DoubleAnyAggregatorFactory("a1", "dbl1"), new FloatAnyAggregatorFactory("a2", "f1") ) ) @@ -1721,7 +1721,7 @@ public void testEarliestAggregatorsNumericNulls() .aggregators( aggregators( new LongFirstAggregatorFactory("a0", "l1", null), - new DoubleFirstAggregatorFactory("a1", "d1", null), + new DoubleFirstAggregatorFactory("a1", "dbl1", null), new FloatFirstAggregatorFactory("a2", "f1", null) ) ) @@ -1748,7 +1748,7 @@ public void testLatestAggregatorsNumericNull() .aggregators( aggregators( new LongLastAggregatorFactory("a0", "l1", null), - new DoubleLastAggregatorFactory("a1", "d1", null), + new DoubleLastAggregatorFactory("a1", "dbl1", null), new FloatLastAggregatorFactory("a2", "f1", null) ) ) @@ -1782,7 +1782,7 @@ public void testFirstLatestAggregatorsSkipNulls() testQuery( "SELECT EARLIEST(dim1, 32), LATEST(l1), LATEST(dbl1), LATEST(f1) " + "FROM druid.numfoo " - + "WHERE dim1 IS NOT NULL AND l1 IS NOT NULL AND d1 IS NOT NULL AND f1 is NOT NULL", + + "WHERE dim1 IS NOT NULL AND l1 IS NOT NULL AND dbl1 IS NOT NULL AND f1 is NOT NULL", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1793,7 +1793,7 @@ public void testFirstLatestAggregatorsSkipNulls() aggregators( new StringFirstAggregatorFactory("a0", "dim1", null, 32), new LongLastAggregatorFactory("a1", "l1", null), - new DoubleLastAggregatorFactory("a2", "d1", null), + new DoubleLastAggregatorFactory("a2", "dbl1", null), new FloatLastAggregatorFactory("a3", "f1", null) ) ) @@ -1811,7 +1811,7 @@ public void testFirstLatestAggregatorsSkipNulls() public void testAnyAggregatorsDoesNotSkipNulls() { testQuery( - "SELECT ANY_VALUE(dim1, 32), ANY_VALUE(l2), ANY_VALUE(d2), ANY_VALUE(f2) FROM druid.numfoo", + "SELECT ANY_VALUE(dim1, 32), ANY_VALUE(l2), ANY_VALUE(dbl2), ANY_VALUE(f2) FROM druid.numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1821,7 +1821,7 @@ public void testAnyAggregatorsDoesNotSkipNulls() aggregators( new StringAnyAggregatorFactory("a0", "dim1", 32, true), new LongAnyAggregatorFactory("a1", "l2"), - new DoubleAnyAggregatorFactory("a2", "d2"), + new DoubleAnyAggregatorFactory("a2", "dbl2"), new FloatAnyAggregatorFactory("a3", "f2") ) ) @@ -1845,14 +1845,14 @@ public void testAnyAggregatorsSkipNullsWithFilter() filter = and( notNull("dim1"), notNull("l2"), - notNull("d2"), + notNull("dbl2"), notNull("f2") ); } testQuery( - "SELECT ANY_VALUE(dim1, 32), ANY_VALUE(l2), ANY_VALUE(d2), ANY_VALUE(f2) " + "SELECT ANY_VALUE(dim1, 32), ANY_VALUE(l2), ANY_VALUE(dbl2), ANY_VALUE(f2) " + "FROM druid.numfoo " - + "WHERE dim1 IS NOT NULL AND l2 IS NOT NULL AND d2 IS NOT NULL AND f2 is NOT NULL", + + "WHERE dim1 IS NOT NULL AND l2 IS NOT NULL AND dbl2 IS NOT NULL AND f2 is NOT NULL", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -1863,7 +1863,7 @@ public void testAnyAggregatorsSkipNullsWithFilter() aggregators( new StringAnyAggregatorFactory("a0", "dim1", 32, true), new LongAnyAggregatorFactory("a1", "l2"), - new DoubleAnyAggregatorFactory("a2", "d2"), + new DoubleAnyAggregatorFactory("a2", "dbl2"), new FloatAnyAggregatorFactory("a3", "f2") ) ) @@ -1955,7 +1955,7 @@ public void testOrderByEarliestDouble() .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( - new DoubleFirstAggregatorFactory("a0", "d1", null) + new DoubleFirstAggregatorFactory("a0", "dbl1", null) ) ) .metric(new InvertedTopNMetricSpec(new NumericTopNMetricSpec("a0"))) @@ -2240,7 +2240,7 @@ public void testOrderByAnyDouble() .dimension(new DefaultDimensionSpec("dim1", "d0")) .aggregators( aggregators( - new DoubleAnyAggregatorFactory("a0", "d1") + new DoubleAnyAggregatorFactory("a0", "dbl1") ) ) .metric(new InvertedTopNMetricSpec(new NumericTopNMetricSpec("a0"))) @@ -2703,7 +2703,7 @@ public void testHavingOnExactCountDistinct() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING))) .setAggregatorSpecs( aggregators( useDefault @@ -3697,13 +3697,13 @@ public void testNullDoubleTopN() ); } testQuery( - "SELECT d1, COUNT(*) FROM druid.numfoo GROUP BY d1 ORDER BY d1 DESC LIMIT 10", + "SELECT dbl1, COUNT(*) FROM druid.numfoo GROUP BY dbl1 ORDER BY dbl1 DESC LIMIT 10", QUERY_CONTEXT_DEFAULT, ImmutableList.of( new TopNQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("d1", "d0", ColumnType.DOUBLE)) + .dimension(new DefaultDimensionSpec("dbl1", "d0", ColumnType.DOUBLE)) .threshold(10) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .metric( @@ -3879,7 +3879,7 @@ public void testDoublePredicateFilterNulls() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .filters(range("d1", ColumnType.LONG, 0L, null, true, false)) + .filters(range("dbl1", ColumnType.LONG, 0L, null, true, false)) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(QUERY_CONTEXT_DEFAULT) .build() @@ -4914,8 +4914,8 @@ public void testSimpleDoubleAggregations() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators(aggregators( - new DoubleMinAggregatorFactory("a0", "d1"), - new DoubleMaxAggregatorFactory("a1", "d1") + new DoubleMinAggregatorFactory("a0", "dbl1"), + new DoubleMaxAggregatorFactory("a1", "dbl1") )) .context(QUERY_CONTEXT_DEFAULT) .build() @@ -7656,7 +7656,7 @@ public void testExactCountDistinctWithGroupingAndOtherAggregators() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0"))) .setAggregatorSpecs(aggregators( new LongSumAggregatorFactory("_a0", "a0"), new FilteredAggregatorFactory( @@ -7726,7 +7726,7 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo ) .setGranularity(Granularities.ALL) .setInterval(querySegmentSpec(Filtration.eternity())) - .setDimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING)) .setAggregatorSpecs( new FilteredAggregatorFactory( new CountAggregatorFactory("a0"), @@ -7757,7 +7757,7 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo ) ) .setInterval(querySegmentSpec(Filtration.eternity())) - .setDimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.STRING)) .setAggregatorSpecs( NullHandling.sqlCompatible() ? new FilteredAggregatorFactory( @@ -7898,7 +7898,7 @@ public void testMultipleExactCountDistinctWithGroupingUsingGroupingSets() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d0", "d0", ColumnType.LONG))) + .setDimensions(dimensions(new DefaultDimensionSpec("d0", "_d0", ColumnType.LONG))) .setAggregatorSpecs(aggregators( new FilteredAggregatorFactory( new CountAggregatorFactory("_a0"), @@ -8086,8 +8086,8 @@ public void testNestedGroupBy() ) ) .setDimensions(dimensions( - new DefaultDimensionSpec("v0", "d0", ColumnType.LONG), - new DefaultDimensionSpec("d0", "d1", ColumnType.STRING) + new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG), + new DefaultDimensionSpec("d0", "_d1", ColumnType.STRING) )) .setAggregatorSpecs( aggregators( @@ -8143,7 +8143,7 @@ public void testDoubleNestedGroupBy() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("d1", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("d1", "_d0"))) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("_a0", "a0"))) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -8539,7 +8539,7 @@ public void testHistogramUsingSubquery() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("a0", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("a0", "_d0"))) .setAggregatorSpecs(aggregators( new CountAggregatorFactory("_a0") )) @@ -8576,7 +8576,7 @@ public void testHistogramUsingSubqueryWithSort() .setDataSource(CalciteTests.DATASOURCE1) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "d0"))) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -8584,14 +8584,14 @@ public void testHistogramUsingSubqueryWithSort() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) - .setDimensions(dimensions(new DefaultDimensionSpec("a0", "d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("a0", "_d0"))) .setAggregatorSpecs(aggregators( new CountAggregatorFactory("_a0") )) .setLimitSpec( new DefaultLimitSpec( ImmutableList.of(new OrderByColumnSpec( - "d0", + "_d0", OrderByColumnSpec.Direction.ASCENDING, StringComparators.LEXICOGRAPHIC )), @@ -10678,15 +10678,15 @@ public void testGroupByAggregatorDefaultValues() equality("dim1", "nonexistent", ColumnType.STRING) ), new FilteredAggregatorFactory( - new DoubleSumAggregatorFactory("a3", "d1"), + new DoubleSumAggregatorFactory("a3", "dbl1"), equality("dim1", "nonexistent", ColumnType.STRING) ), new FilteredAggregatorFactory( - new DoubleMaxAggregatorFactory("a4", "d1"), + new DoubleMaxAggregatorFactory("a4", "dbl1"), equality("dim1", "nonexistent", ColumnType.STRING) ), new FilteredAggregatorFactory( - new DoubleMinAggregatorFactory("a5", "d1"), + new DoubleMinAggregatorFactory("a5", "dbl1"), equality("dim1", "nonexistent", ColumnType.STRING) ), new FilteredAggregatorFactory( @@ -10718,7 +10718,7 @@ public void testGroupByAggregatorDefaultValues() ) ), new FilteredAggregatorFactory( - new DoubleSumAggregatorFactory("a10:sum", "d1"), + new DoubleSumAggregatorFactory("a10:sum", "dbl1"), equality("dim1", "nonexistent", ColumnType.STRING) ), useDefault @@ -11458,17 +11458,17 @@ public void testGroupByTimeFloorAndDimOnGroupByTimeFloorAndDim() .setGranularity(Granularities.ALL) .setDimensions( dimensions( - new DefaultDimensionSpec("d1", "d0"), - new DefaultDimensionSpec("p0", "d1", ColumnType.LONG) + new DefaultDimensionSpec("d1", "_d0"), + new DefaultDimensionSpec("p0", "_d1", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new DoubleSumAggregatorFactory("_a0", "a0"))) .setLimitSpec( new DefaultLimitSpec( ImmutableList.of( - new OrderByColumnSpec("d0", OrderByColumnSpec.Direction.ASCENDING), + new OrderByColumnSpec("_d0", OrderByColumnSpec.Direction.ASCENDING), new OrderByColumnSpec( - "d1", + "_d1", Direction.DESCENDING, StringComparators.NUMERIC ) @@ -13264,13 +13264,13 @@ public void testFilterFloatDimension() public void testFilterDoubleDimension() { testQuery( - "SELECT dim1 FROM numfoo WHERE d1 = 1.7 LIMIT 1", + "SELECT dim1 FROM numfoo WHERE dbl1 = 1.7 LIMIT 1", ImmutableList.of( newScanQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) .columns("dim1") - .filters(equality("d1", 1.7, ColumnType.DOUBLE)) + .filters(equality("dbl1", 1.7, ColumnType.DOUBLE)) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .limit(1) .context(QUERY_CONTEXT_DEFAULT) From bd72b95777941d19ed23d80732e7ff28203e6723 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 14:01:45 +0000 Subject: [PATCH 18/99] fix some --- .../sql/calcite/CalciteArraysQueryTest.java | 24 +++++++++---------- .../sql/calcite/CalciteJoinQueryTest.java | 16 ++++++------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 0e8faad878e0..d813b1efb3a6 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -1996,7 +1996,7 @@ public void testArrayGroupAsDoubleArray() // Cannot vectorize as we donot have support in native query subsytem for grouping on arrays as keys cannotVectorize(); testQuery( - "SELECT ARRAY[d1], SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", + "SELECT ARRAY[dbl1], SUM(cnt) FROM druid.numfoo GROUP BY 1 ORDER BY 2 DESC", QUERY_CONTEXT_NO_STRINGIFY_ARRAY, ImmutableList.of( GroupByQuery.builder() @@ -2005,7 +2005,7 @@ public void testArrayGroupAsDoubleArray() .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn( "v0", - "array(\"d1\")", + "array(\"dbl1\")", ColumnType.DOUBLE_ARRAY )) .setDimensions( @@ -2197,7 +2197,7 @@ public void testArrayOrdinal() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -2615,14 +2615,14 @@ public void testArrayAggNumeric() ), new ExpressionLambdaAggregatorFactory( "a2", - ImmutableSet.of("d1"), + ImmutableSet.of("dbl1"), "__acc", "ARRAY[]", "ARRAY[]", true, true, false, - "array_append(\"__acc\", \"d1\")", + "array_append(\"__acc\", \"dbl1\")", "array_concat(\"__acc\", \"a2\")", null, null, @@ -2631,14 +2631,14 @@ public void testArrayAggNumeric() ), new ExpressionLambdaAggregatorFactory( "a3", - ImmutableSet.of("d1"), + ImmutableSet.of("dbl1"), "__acc", "ARRAY[]", "ARRAY[]", true, true, false, - "array_set_add(\"__acc\", \"d1\")", + "array_set_add(\"__acc\", \"dbl1\")", "array_set_add_all(\"__acc\", \"a3\")", null, null, @@ -3423,7 +3423,7 @@ public void testArrayAggAsArrayFromJoin() .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) .setDimFilter(notNull("dim1")) - .setDimensions(new DefaultDimensionSpec("dim4", "_d0")) + .setDimensions(new DefaultDimensionSpec("dim4", "d0")) .setAggregatorSpecs( aggregators( new ExpressionLambdaAggregatorFactory( @@ -3448,7 +3448,7 @@ public void testArrayAggAsArrayFromJoin() .build() ), "j0.", - "(\"dim4\" == \"j0._d0\")", + "(\"dim4\" == \"j0.d0\")", JoinType.INNER, null ) @@ -3545,7 +3545,7 @@ public void testArrayAggGroupByArrayAggOfLongsFromSubquery() .setContext(QUERY_CONTEXT_NO_STRINGIFY_ARRAY) .setDimensions( new DefaultDimensionSpec("dim1", "d0"), - new DefaultDimensionSpec("dim2", "d1"), + new DefaultDimensionSpec("dim2", "dbl1"), new DefaultDimensionSpec("dim3", "d2" ) ) @@ -5612,13 +5612,13 @@ public void testUnnestWithGroupByOrderByOnVirtualColumn() ) .setInterval(querySegmentSpec(Filtration.eternity())) .setContext(QUERY_CONTEXT_UNNEST) - .setDimensions(new DefaultDimensionSpec("j0.unnest", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("j0.unnest", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setLimitSpec( DefaultLimitSpec .builder() .orderBy(new OrderByColumnSpec( - "_d0", + "d0", OrderByColumnSpec.Direction.DESCENDING, StringComparators.LEXICOGRAPHIC )) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java index 68db38052754..4bc8857a86ef 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java @@ -145,7 +145,7 @@ public void testInnerJoinWithLimitAndAlias() .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) .setDataSource(new TableDataSource("numfoo")) - .setDimensions(new DefaultDimensionSpec("__time", "_d0", ColumnType.LONG)) + .setDimensions(new DefaultDimensionSpec("__time", "d0", ColumnType.LONG)) .setContext(context) .build() ), @@ -159,14 +159,14 @@ public void testInnerJoinWithLimitAndAlias() .build() ), "j0.", - "(\"_d0\" == \"j0.d0\")", + "(\"d0\" == \"j0.d0\")", JoinType.INNER, null, ExprMacroTable.nil(), CalciteTests.createJoinableFactoryWrapper() ) ) - .columns("_d0") + .columns("d0") .context(context) .build() ), @@ -199,7 +199,7 @@ public void testExactTopNOnInnerJoinWithLimit() new TopNQueryBuilder() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("dim4", "_d0")) + .dimension(new DefaultDimensionSpec("dim4", "d0")) .aggregators(new DoubleSumAggregatorFactory("a0", "m1")) .metric(new DimensionTopNMetricSpec(null, StringComparators.LEXICOGRAPHIC)) .threshold(1) @@ -212,12 +212,12 @@ public void testExactTopNOnInnerJoinWithLimit() .setGranularity(Granularities.ALL) .setDimFilter(not(equality("dim4", "a", ColumnType.STRING))) .setDataSource(new TableDataSource("numfoo")) - .setDimensions(new DefaultDimensionSpec("dim4", "_d0")) + .setDimensions(new DefaultDimensionSpec("dim4", "d0")) .setContext(context) .build() ), "j0.", - "(\"dim4\" == \"j0._d0\")", + "(\"dim4\" == \"j0.d0\")", JoinType.INNER, null, ExprMacroTable.nil(), @@ -5173,7 +5173,7 @@ public void testTopNOnStringWithNonSortedOrUniqueDictionary(Map ) ) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("j0.dim4", "_d0", ColumnType.STRING)) + .dimension(new DefaultDimensionSpec("j0.dim4", "d0", ColumnType.STRING)) .threshold(4) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(queryContext) @@ -5214,7 +5214,7 @@ public void testTopNOnStringWithNonSortedOrUniqueDictionaryOrderByDim(Map Date: Wed, 13 Nov 2024 14:12:25 +0000 Subject: [PATCH 19/99] fix some more --- .../sql/calcite/CalciteArraysQueryTest.java | 132 ++++++++---------- 1 file changed, 61 insertions(+), 71 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index d813b1efb3a6..b4256cac198f 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -157,7 +157,7 @@ public void testGroupByArrayFromCase() "case_searched((\"dim4\" == 'a'),array('foo','bar','baz'),null)", ColumnType.STRING_ARRAY )) - .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING_ARRAY)) + .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING_ARRAY)) .setGranularity(Granularities.ALL) .setAggregatorSpecs(new CountAggregatorFactory("a0")) .setContext(QUERY_CONTEXT_DEFAULT) @@ -336,8 +336,8 @@ public void testSomeArrayFunctionsWithScanQuery() + " dim3," + " l1," + " l2," - + " d1," - + " d2," + + " dbl1," + + " dbl2," + " ARRAY['a', 'b', 'c']," + " ARRAY[1,2,3]," + " ARRAY[1.9, 2.2, 4.3]," @@ -345,15 +345,15 @@ public void testSomeArrayFunctionsWithScanQuery() + " ARRAY_PREPEND('foo', ARRAY[dim2])," + " ARRAY_APPEND(ARRAY[1,2], l1)," + " ARRAY_PREPEND(l2, ARRAY[1,2])," - + " ARRAY_APPEND(ARRAY[1.2,2.2], d1)," - + " ARRAY_PREPEND(d2, ARRAY[1.1,2.2])," + + " ARRAY_APPEND(ARRAY[1.2,2.2], dbl1)," + + " ARRAY_PREPEND(dbl2, ARRAY[1.1,2.2])," + " ARRAY_CONCAT(dim2,dim3)," + " ARRAY_CONCAT(ARRAY[l1],ARRAY[l2])," - + " ARRAY_CONCAT(ARRAY[d1],ARRAY[d2])," + + " ARRAY_CONCAT(ARRAY[dbl1],ARRAY[dbl2])," + " ARRAY_OFFSET(ARRAY[l1],0)," - + " ARRAY_OFFSET(ARRAY[d1],0)," + + " ARRAY_OFFSET(ARRAY[dbl1],0)," + " ARRAY_ORDINAL(ARRAY[l1],1)," - + " ARRAY_ORDINAL(ARRAY[d1],1)" + + " ARRAY_ORDINAL(ARRAY[dbl1],1)" + " FROM druid.numfoo" + " LIMIT 1", ImmutableList.of( @@ -367,25 +367,25 @@ public void testSomeArrayFunctionsWithScanQuery() expressionVirtualColumn("v10", "array_concat(array(\"l1\"),array(\"l2\"))", ColumnType.LONG_ARRAY), expressionVirtualColumn( "v11", - "array_concat(array(\"d1\"),array(\"d2\"))", + "array_concat(array(\"dbl1\"),array(\"dbl2\"))", ColumnType.DOUBLE_ARRAY ), expressionVirtualColumn("v12", "array_offset(array(\"l1\"),0)", ColumnType.LONG), - expressionVirtualColumn("v13", "array_offset(array(\"d1\"),0)", ColumnType.DOUBLE), + expressionVirtualColumn("v13", "array_offset(array(\"dbl1\"),0)", ColumnType.DOUBLE), expressionVirtualColumn("v14", "array_ordinal(array(\"l1\"),1)", ColumnType.LONG), - expressionVirtualColumn("v15", "array_ordinal(array(\"d1\"),1)", ColumnType.DOUBLE), + expressionVirtualColumn("v15", "array_ordinal(array(\"dbl1\"),1)", ColumnType.DOUBLE), expressionVirtualColumn("v2", "array(1.9,2.2,4.3)", ColumnType.DOUBLE_ARRAY), expressionVirtualColumn("v3", "array_append(\"dim3\",'foo')", ColumnType.STRING_ARRAY), expressionVirtualColumn("v4", "array_prepend('foo',array(\"dim2\"))", ColumnType.STRING_ARRAY), expressionVirtualColumn("v5", "array_append(array(1,2),\"l1\")", ColumnType.LONG_ARRAY), expressionVirtualColumn("v6", "array_prepend(\"l2\",array(1,2))", ColumnType.LONG_ARRAY), - expressionVirtualColumn("v7", "array_append(array(1.2,2.2),\"d1\")", ColumnType.DOUBLE_ARRAY), - expressionVirtualColumn("v8", "array_prepend(\"d2\",array(1.1,2.2))", ColumnType.DOUBLE_ARRAY), + expressionVirtualColumn("v7", "array_append(array(1.2,2.2),\"dbl1\")", ColumnType.DOUBLE_ARRAY), + expressionVirtualColumn("v8", "array_prepend(\"dbl2\",array(1.1,2.2))", ColumnType.DOUBLE_ARRAY), expressionVirtualColumn("v9", "array_concat(\"dim2\",\"dim3\")", ColumnType.STRING_ARRAY) ) .columns( - "d1", - "d2", + "dbl1", + "dbl2", "dim1", "dim2", "dim3", @@ -420,8 +420,8 @@ public void testSomeArrayFunctionsWithScanQuery() .add("dim3", ColumnType.STRING) .add("l1", ColumnType.LONG) .add("l2", ColumnType.LONG) - .add("d1", ColumnType.DOUBLE) - .add("d2", ColumnType.DOUBLE) + .add("dbl1", ColumnType.DOUBLE) + .add("dbl2", ColumnType.DOUBLE) .add("EXPR$7", ColumnType.STRING_ARRAY) .add("EXPR$8", ColumnType.LONG_ARRAY) .add("EXPR$9", ColumnType.DOUBLE_ARRAY) @@ -634,11 +634,11 @@ public void testSomeArrayFunctionsWithScanQueryNoStringify() + " ARRAY_PREPEND('foo', ARRAY[dim2])," + " ARRAY_APPEND(ARRAY[1,2], l1)," + " ARRAY_PREPEND(l2, ARRAY[1,2])," - + " ARRAY_APPEND(ARRAY[1.2,2.2], d1)," - + " ARRAY_PREPEND(d2, ARRAY[1.1,2.2])," + + " ARRAY_APPEND(ARRAY[1.2,2.2], dbl1)," + + " ARRAY_PREPEND(dbl2, ARRAY[1.1,2.2])," + " ARRAY_CONCAT(dim2,dim3)," + " ARRAY_CONCAT(ARRAY[l1],ARRAY[l2])," - + " ARRAY_CONCAT(ARRAY[d1],ARRAY[d2])" + + " ARRAY_CONCAT(ARRAY[dbl1],ARRAY[dbl2])" + " FROM druid.numfoo" + " LIMIT 1", QUERY_CONTEXT_NO_STRINGIFY_ARRAY, @@ -652,7 +652,7 @@ public void testSomeArrayFunctionsWithScanQueryNoStringify() expressionVirtualColumn("v10", "array_concat(array(\"l1\"),array(\"l2\"))", ColumnType.LONG_ARRAY), expressionVirtualColumn( "v11", - "array_concat(array(\"d1\"),array(\"d2\"))", + "array_concat(array(\"dbl1\"),array(\"dbl2\"))", ColumnType.DOUBLE_ARRAY ), expressionVirtualColumn("v2", "array(1.9,2.2,4.3)", ColumnType.DOUBLE_ARRAY), @@ -660,8 +660,8 @@ public void testSomeArrayFunctionsWithScanQueryNoStringify() expressionVirtualColumn("v4", "array_prepend('foo',array(\"dim2\"))", ColumnType.STRING_ARRAY), expressionVirtualColumn("v5", "array_append(array(1,2),\"l1\")", ColumnType.LONG_ARRAY), expressionVirtualColumn("v6", "array_prepend(\"l2\",array(1,2))", ColumnType.LONG_ARRAY), - expressionVirtualColumn("v7", "array_append(array(1.2,2.2),\"d1\")", ColumnType.DOUBLE_ARRAY), - expressionVirtualColumn("v8", "array_prepend(\"d2\",array(1.1,2.2))", ColumnType.DOUBLE_ARRAY), + expressionVirtualColumn("v7", "array_append(array(1.2,2.2),\"dbl1\")", ColumnType.DOUBLE_ARRAY), + expressionVirtualColumn("v8", "array_prepend(\"dbl2\",array(1.1,2.2))", ColumnType.DOUBLE_ARRAY), expressionVirtualColumn("v9", "array_concat(\"dim2\",\"dim3\")", ColumnType.STRING_ARRAY) ) .columns( @@ -936,7 +936,7 @@ public void testArrayOverlapFilterWithDynamicParameter() Druids.ScanQueryBuilder builder = newScanQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .filters(expressionFilter("array_overlap(array(1.0,1.7,null),array(\"d1\"))")) + .filters(expressionFilter("array_overlap(array(1.0,1.7,null),array(\"dbl1\"))")) .columns("dim3") .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .limit(5) @@ -948,7 +948,7 @@ public void testArrayOverlapFilterWithDynamicParameter() ImmutableList.of( new SqlParameter(SqlType.ARRAY, Arrays.asList(1.0, 1.7, null)) ), - "SELECT dim3 FROM druid.numfoo WHERE ARRAY_OVERLAP(?, ARRAY[d1]) LIMIT 5", + "SELECT dim3 FROM druid.numfoo WHERE ARRAY_OVERLAP(?, ARRAY[dbl1]) LIMIT 5", CalciteTests.REGULAR_USER_AUTH_RESULT, ImmutableList.of(builder.build()), NullHandling.sqlCompatible() ? ImmutableList.of( @@ -1306,7 +1306,7 @@ public void testArrayContainsFilterWithDynamicParameter() Druids.ScanQueryBuilder builder = newScanQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) .intervals(querySegmentSpec(Filtration.eternity())) - .filters(expressionFilter("array_contains(array(1,null),array((\"d1\" > 1)))")) + .filters(expressionFilter("array_contains(array(1,null),array((\"dbl1\" > 1)))")) .columns("dim3") .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .limit(5) @@ -1318,7 +1318,7 @@ public void testArrayContainsFilterWithDynamicParameter() ImmutableList.of( new SqlParameter(SqlType.ARRAY, Arrays.asList(true, null)) ), - "SELECT dim3 FROM druid.numfoo WHERE ARRAY_CONTAINS(?, ARRAY[d1>1]) LIMIT 5", + "SELECT dim3 FROM druid.numfoo WHERE ARRAY_CONTAINS(?, ARRAY[dbl1>1]) LIMIT 5", CalciteTests.REGULAR_USER_AUTH_RESULT, ImmutableList.of(builder.build()), NullHandling.sqlCompatible() ? ImmutableList.of( @@ -1539,14 +1539,14 @@ public void testArrayLength() .setVirtualColumns(expressionVirtualColumn("v0", "array_length(\"dim3\")", ColumnType.LONG)) .setDimensions( dimensions( - new DefaultDimensionSpec("dim1", "_d0", ColumnType.STRING), - new DefaultDimensionSpec("v0", "_d1", ColumnType.LONG) + new DefaultDimensionSpec("dim1", "d0", ColumnType.STRING), + new DefaultDimensionSpec("v0", "d1", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) .setLimitSpec(new DefaultLimitSpec( ImmutableList.of(new OrderByColumnSpec( - "_d1", + "d1", OrderByColumnSpec.Direction.DESCENDING, StringComparators.NUMERIC )), @@ -1662,7 +1662,7 @@ public void testArrayAppend() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING_ARRAY) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING_ARRAY) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1719,7 +1719,7 @@ public void testArrayPrepend() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING_ARRAY) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING_ARRAY) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1780,8 +1780,8 @@ public void testArrayPrependAppend() ) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING), - new DefaultDimensionSpec("v1", "_d1", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING), + new DefaultDimensionSpec("v1", "d1", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1838,7 +1838,7 @@ public void testArrayConcat() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING_ARRAY) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING_ARRAY) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1871,7 +1871,7 @@ public void testArrayOffset() .setVirtualColumns(expressionVirtualColumn("v0", "array_offset(\"dim3\",1)", ColumnType.STRING)) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1914,7 +1914,7 @@ public void testArrayGroupAsLongArray() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG_ARRAY) + new DefaultDimensionSpec("v0", "d0", ColumnType.LONG_ARRAY) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -2010,7 +2010,7 @@ public void testArrayGroupAsDoubleArray() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.DOUBLE_ARRAY) + new DefaultDimensionSpec("v0", "d0", ColumnType.DOUBLE_ARRAY) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -2106,7 +2106,7 @@ public void testArrayGroupAsFloatArray() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.ofArray(ColumnType.FLOAT)) + new DefaultDimensionSpec("v0", "d0", ColumnType.ofArray(ColumnType.FLOAT)) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -2155,7 +2155,7 @@ public void testArrayGroupAsArrayWithFunction() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING_ARRAY) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING_ARRAY) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -2238,7 +2238,7 @@ public void testArrayOffsetOf() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG) + new DefaultDimensionSpec("v0", "d0", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -2285,7 +2285,7 @@ public void testArrayOrdinalOf() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG) + new DefaultDimensionSpec("v0", "d0", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -2350,7 +2350,7 @@ public void testArrayToString() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -2409,7 +2409,7 @@ public void testArrayToStringToMultiValueString() .setDimFilter(range("v0", ColumnType.LONG, 0L, null, true, false)) .setDimensions( dimensions( - new DefaultDimensionSpec("v1", "_d0", ColumnType.STRING_ARRAY) + new DefaultDimensionSpec("v1", "d0", ColumnType.STRING_ARRAY) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -2573,7 +2573,7 @@ public void testArrayAggNumeric() { cannotVectorize(); testQuery( - "SELECT ARRAY_AGG(l1), ARRAY_AGG(DISTINCT l1), ARRAY_AGG(d1), ARRAY_AGG(DISTINCT d1), ARRAY_AGG(f1), ARRAY_AGG(DISTINCT f1) FROM numfoo", + "SELECT ARRAY_AGG(l1), ARRAY_AGG(DISTINCT l1), ARRAY_AGG(dbl1), ARRAY_AGG(DISTINCT dbl1), ARRAY_AGG(f1), ARRAY_AGG(DISTINCT f1) FROM numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE3) @@ -3545,7 +3545,7 @@ public void testArrayAggGroupByArrayAggOfLongsFromSubquery() .setContext(QUERY_CONTEXT_NO_STRINGIFY_ARRAY) .setDimensions( new DefaultDimensionSpec("dim1", "d0"), - new DefaultDimensionSpec("dim2", "dbl1"), + new DefaultDimensionSpec("dim2", "d1"), new DefaultDimensionSpec("dim3", "d2" ) ) @@ -3556,14 +3556,8 @@ public void testArrayAggGroupByArrayAggOfLongsFromSubquery() querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) .setDimensions( - new DefaultDimensionSpec( - "d0", - "_d0" - ), - new DefaultDimensionSpec( - "d1", - "_d1" - ) + new DefaultDimensionSpec("d0", "_d0"), + new DefaultDimensionSpec("d1", "_d1") ) .setAggregatorSpecs(new ExpressionLambdaAggregatorFactory( "_a0", @@ -3619,11 +3613,9 @@ public void testArrayAggGroupByArrayAggOfStringsFromSubquery() .setDimensions( new DefaultDimensionSpec("dim1", "d0"), new DefaultDimensionSpec("dim2", "d1"), - new DefaultDimensionSpec("dim3", "d2" - ) + new DefaultDimensionSpec("dim3", "d2") ) - .setAggregatorSpecs( - new CountAggregatorFactory("a0")) + .setAggregatorSpecs(new CountAggregatorFactory("a0")) .build())) .setQuerySegmentSpec(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) @@ -3686,11 +3678,9 @@ public void testArrayAggGroupByArrayAggOfDoubleFromSubquery() .setDimensions( new DefaultDimensionSpec("dim1", "d0"), new DefaultDimensionSpec("dim2", "d1"), - new DefaultDimensionSpec("dim3", "d2" - ) + new DefaultDimensionSpec("dim3", "d2") ) - .setAggregatorSpecs( - new CountAggregatorFactory("a0")) + .setAggregatorSpecs(new CountAggregatorFactory("a0")) .build())) .setQuerySegmentSpec(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) @@ -4934,7 +4924,7 @@ public void testUnnestWithGroupBy() )) .setInterval(querySegmentSpec(Filtration.eternity())) .setContext(QUERY_CONTEXT_UNNEST) - .setDimensions(new DefaultDimensionSpec("j0.unnest", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("j0.unnest", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setContext(QUERY_CONTEXT_UNNEST) .build() @@ -5005,13 +4995,13 @@ public void testUnnestWithGroupByOrderBy() )) .setInterval(querySegmentSpec(Filtration.eternity())) .setContext(QUERY_CONTEXT_UNNEST) - .setDimensions(new DefaultDimensionSpec("j0.unnest", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("j0.unnest", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setLimitSpec( DefaultLimitSpec .builder() .orderBy(new OrderByColumnSpec( - "_d0", + "d0", OrderByColumnSpec.Direction.DESCENDING, StringComparators.LEXICOGRAPHIC )) @@ -5055,7 +5045,7 @@ public void testUnnestWithGroupByOrderByWithLimit() null )) .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("j0.unnest", "_d0", ColumnType.STRING)) + .dimension(new DefaultDimensionSpec("j0.unnest", "d0", ColumnType.STRING)) .metric(new DimensionTopNMetricSpec(null, StringComparators.LEXICOGRAPHIC)) .threshold(4) .aggregators(aggregators(new CountAggregatorFactory("a0"))) @@ -5094,7 +5084,7 @@ public void testUnnestWithGroupByHaving() )) .setInterval(querySegmentSpec(Filtration.eternity())) .setContext(QUERY_CONTEXT_UNNEST) - .setDimensions(new DefaultDimensionSpec("j0.unnest", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("j0.unnest", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setAggregatorSpecs(new CountAggregatorFactory("a0")) .setHavingSpec(new DimFilterHavingSpec(equality("a0", 1L, ColumnType.LONG), true)) @@ -5895,7 +5885,7 @@ public void testUnnestWithInvalidINFiltersOnUnnestedColumn() public void testUnnestWithNotFiltersOnUnnestedColumn() { testQuery( - "SELECT d3,MV_TO_ARRAY(dim3) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3!='d' ", + "SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3!='d' ", QUERY_CONTEXT_UNNEST, ImmutableList.of( Druids.newScanQueryBuilder() @@ -6353,7 +6343,7 @@ public void testUnnestWithGroupByHavingSelector() )) .setInterval(querySegmentSpec(Filtration.eternity())) .setContext(QUERY_CONTEXT_UNNEST) - .setDimensions(new DefaultDimensionSpec("j0.unnest", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("j0.unnest", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setDimFilter(equality("j0.unnest", "b", ColumnType.STRING)) .setAggregatorSpecs(new CountAggregatorFactory("a0")) @@ -6462,7 +6452,7 @@ public void testUnnestWithGroupByHavingWithWhereOnAggCol() )) .setInterval(querySegmentSpec(Filtration.eternity())) .setContext(QUERY_CONTEXT_UNNEST) - .setDimensions(new DefaultDimensionSpec("j0.unnest", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("j0.unnest", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setAggregatorSpecs(new CountAggregatorFactory("a0")) .setHavingSpec(new DimFilterHavingSpec(equality("a0", 1L, ColumnType.LONG), true)) @@ -6492,7 +6482,7 @@ public void testUnnestWithGroupByHavingWithWhereOnUnnestCol() )) .setInterval(querySegmentSpec(Filtration.eternity())) .setContext(QUERY_CONTEXT_UNNEST) - .setDimensions(new DefaultDimensionSpec("j0.unnest", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("j0.unnest", "d0", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setAggregatorSpecs(new CountAggregatorFactory("a0")) .setDimFilter(equality("j0.unnest", "a", ColumnType.STRING)) From 62664e36e7a3b8c65da8fabd575bb62e1b6624c9 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 14:16:48 +0000 Subject: [PATCH 20/99] fix windowtests --- .../calcite/tests/window/WindowOpReorder.sqlTest | 8 ++++---- .../calcite/tests/window/arrayAggWithOrderBy.sqlTest | 8 ++++---- .../calcite/tests/window/defaultBoundCurrentRow.sqlTest | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sql/src/test/resources/calcite/tests/window/WindowOpReorder.sqlTest b/sql/src/test/resources/calcite/tests/window/WindowOpReorder.sqlTest index a2f82ff2905d..32f0cac4d241 100644 --- a/sql/src/test/resources/calcite/tests/window/WindowOpReorder.sqlTest +++ b/sql/src/test/resources/calcite/tests/window/WindowOpReorder.sqlTest @@ -17,19 +17,19 @@ expectedOperators: type: "framedAgg" frame: { type: "rows" } aggregations: - - { "type": "doubleSum", "name": "w1", "fieldName": "_d1" } + - { "type": "doubleSum", "name": "w1", "fieldName": "d1" } - type: "naiveSort" columns: - - column: "_d1" + - column: "d1" direction: "ASC" - type: "naivePartition" - partitionColumns: [ "_d1" ] + partitionColumns: [ "d1" ] - type: "window" processor: type: "framedAgg" frame: { type: "rows" } aggregations: - - { "type": "doubleSum", "name": "w0", "fieldName": "_d0" } + - { "type": "doubleSum", "name": "w0", "fieldName": "d0" } expectedResults: - [1.0, 1.0, 1.0, 21.0] - [2.0, 2.0, 2.0, 21.0] diff --git a/sql/src/test/resources/calcite/tests/window/arrayAggWithOrderBy.sqlTest b/sql/src/test/resources/calcite/tests/window/arrayAggWithOrderBy.sqlTest index 3cbdf42af6fd..4aa4f0164679 100644 --- a/sql/src/test/resources/calcite/tests/window/arrayAggWithOrderBy.sqlTest +++ b/sql/src/test/resources/calcite/tests/window/arrayAggWithOrderBy.sqlTest @@ -3,11 +3,11 @@ type: "operatorValidation" sql: | SELECT count(*) over (), - ARRAY_AGG(d1, 100), ARRAY_AGG(f1, 100), ARRAY_AGG(m1, 100) + ARRAY_AGG(dbl1, 100), ARRAY_AGG(f1, 100), ARRAY_AGG(m1, 100) FROM numfoo - WHERE d1>0 AND f1>0 - GROUP BY d1, f1, m1 - ORDER BY d1, f1, m1 + WHERE dbl1>0 AND f1>0 + GROUP BY dbl1, f1, m1 + ORDER BY dbl1, f1, m1 expectedResults: - [2,[1.0],[1.0],[1.0]] diff --git a/sql/src/test/resources/calcite/tests/window/defaultBoundCurrentRow.sqlTest b/sql/src/test/resources/calcite/tests/window/defaultBoundCurrentRow.sqlTest index d5289523135c..1a79c598156d 100644 --- a/sql/src/test/resources/calcite/tests/window/defaultBoundCurrentRow.sqlTest +++ b/sql/src/test/resources/calcite/tests/window/defaultBoundCurrentRow.sqlTest @@ -14,8 +14,8 @@ sql: | WINDOW W AS (partition by dim2 ORDER BY dim1 ROWS UNBOUNDED FOLLOWING) expectedOperators: - - {"type":"naiveSort","columns":[{"column":"_d1","direction":"ASC"},{"column":"_d0","direction":"ASC"}]} - - { type: "naivePartition", partitionColumns: [ "_d1" ] } + - {"type":"naiveSort","columns":[{"column":"d1","direction":"ASC"},{"column":"d0","direction":"ASC"}]} + - { type: "naivePartition", partitionColumns: [ "d1" ] } - type: "window" processor: type: "framedAgg" From 08748436a5bbbaf7b894045acb576bcf4939ccd7 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 14:20:41 +0000 Subject: [PATCH 21/99] fix some more --- .../CalciteMultiValueStringQueryTest.java | 72 +++++++++---------- .../sql/calcite/CalciteSelectQueryTest.java | 12 ++-- .../sql/calcite/CalciteTableAppendTest.java | 8 +-- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteMultiValueStringQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteMultiValueStringQueryTest.java index 4ce75b6270d3..ad89e5e94a61 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteMultiValueStringQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteMultiValueStringQueryTest.java @@ -100,7 +100,7 @@ public void testMultiValueStringWorksLikeStringGroupBy() .setVirtualColumns(expressionVirtualColumn("v0", "concat(\"dim3\",'foo')", ColumnType.STRING)) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -159,7 +159,7 @@ public void testMultiValueStringWorksLikeStringGroupByWithFilter() .setGranularity(Granularities.ALL) .setVirtualColumns( expressionVirtualColumn("v0", "concat(\"dim3\",'','foo')", ColumnType.STRING)) - .setDimensions(dimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING))) + .setDimensions(dimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING))) .setDimFilter(equality("v0", "bfoo", ColumnType.STRING)) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) .setLimitSpec(new DefaultLimitSpec( @@ -480,14 +480,14 @@ public void testMultiValueStringLength() .setVirtualColumns(expressionVirtualColumn("v0", "array_length(\"dim3\")", ColumnType.LONG)) .setDimensions( dimensions( - new DefaultDimensionSpec("dim1", "_d0", ColumnType.STRING), - new DefaultDimensionSpec("v0", "_d1", ColumnType.LONG) + new DefaultDimensionSpec("dim1", "d0", ColumnType.STRING), + new DefaultDimensionSpec("v0", "d1", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) .setLimitSpec(new DefaultLimitSpec( ImmutableList.of(new OrderByColumnSpec( - "_d1", + "d1", OrderByColumnSpec.Direction.DESCENDING, StringComparators.NUMERIC )), @@ -548,7 +548,7 @@ public void testMultiValueStringAppend() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -608,7 +608,7 @@ public void testMultiValueStringPrepend() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -669,8 +669,8 @@ public void testMultiValueStringPrependAppend() ) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING), - new DefaultDimensionSpec("v1", "_d1", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING), + new DefaultDimensionSpec("v1", "d1", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -728,7 +728,7 @@ public void testMultiValueStringConcat() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -788,7 +788,7 @@ public void testMultiValueStringConcatBackwardsCompat0dot22andOlder() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -825,7 +825,7 @@ public void testMultiValueStringOffset() .setVirtualColumns(expressionVirtualColumn("v0", "array_offset(\"dim3\",1)", ColumnType.STRING)) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -866,7 +866,7 @@ public void testMultiValueStringOrdinal() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -907,7 +907,7 @@ public void testMultiValueStringOffsetOf() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG) + new DefaultDimensionSpec("v0", "d0", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -954,7 +954,7 @@ public void testMultiValueStringOrdinalOf() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG) + new DefaultDimensionSpec("v0", "d0", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1019,7 +1019,7 @@ public void testMultiValueStringToString() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1077,7 +1077,7 @@ public void testMultiValueStringToStringToMultiValueString() ) ) .setDimFilter(range("v0", ColumnType.LONG, 0L, null, true, false)) - .setDimensions(dimensions(new DefaultDimensionSpec("v1", "_d0", ColumnType.STRING))) + .setDimensions(dimensions(new DefaultDimensionSpec("v1", "d0", ColumnType.STRING))) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) .setLimitSpec(new DefaultLimitSpec( ImmutableList.of( @@ -1087,7 +1087,7 @@ public void testMultiValueStringToStringToMultiValueString() StringComparators.NUMERIC ), new OrderByColumnSpec( - "_d0", + "d0", OrderByColumnSpec.Direction.ASCENDING, StringComparators.LEXICOGRAPHIC ) @@ -1158,7 +1158,7 @@ public void testStringToMVOfConstant() "string_to_array('a,b',',')", ColumnType.STRING )) - .setDimensions(dimensions(new DefaultDimensionSpec("m1", "_d0", ColumnType.FLOAT))) + .setDimensions(dimensions(new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT))) .setContext(QUERY_CONTEXT_DEFAULT) .build() ) @@ -1192,8 +1192,8 @@ public void testStringToMVOfConstantGroupedBy() expressionVirtualColumn("v0", "string_to_array('a,b',',')", ColumnType.STRING) ) .setDimensions(dimensions( - new DefaultDimensionSpec("m1", "_d0", ColumnType.FLOAT), - new DefaultDimensionSpec("v0", "_d1", ColumnType.STRING) + new DefaultDimensionSpec("m1", "d0", ColumnType.FLOAT), + new DefaultDimensionSpec("v0", "d1", ColumnType.STRING) )) .setContext(QUERY_CONTEXT_DEFAULT) .build() @@ -1290,7 +1290,7 @@ public void testMultiValueListFilter() ) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1367,7 +1367,7 @@ public void testMultiValueListFilterDeny() ) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1459,7 +1459,7 @@ public void testMultiValueListFilterComposed() ) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG) + new DefaultDimensionSpec("v0", "d0", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1516,7 +1516,7 @@ public void testMultiValueListFilterComposedNested() ) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1583,7 +1583,7 @@ public void testMultiValueListFilterComposedNested2Input() ) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1641,7 +1641,7 @@ public void testMultiValueListFilterComposedNestedNullLiteral() ) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1698,7 +1698,7 @@ public void testMultiValueListFilterComposedDeny() ) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG) + new DefaultDimensionSpec("v0", "d0", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1752,8 +1752,8 @@ public void testMultiValueListFilterComposedMultipleExpressions() ) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.LONG), - new DefaultDimensionSpec("v1", "_d1", ColumnType.LONG) + new DefaultDimensionSpec("v0", "d0", ColumnType.LONG), + new DefaultDimensionSpec("v1", "d1", ColumnType.LONG) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1804,7 +1804,7 @@ public void testFilterOnMultiValueListFilterNoMatch() .setDimFilter(equality("v0", "a", ColumnType.STRING)) .setDimensions( dimensions( - new DefaultDimensionSpec("dim3", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("dim3", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1847,7 +1847,7 @@ public void testFilterOnMultiValueListFilterMatch() .setDimFilter(equality("v0", "b", ColumnType.STRING)) .setDimensions( dimensions( - new DefaultDimensionSpec("dim3", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("dim3", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1894,7 +1894,7 @@ public void testFilterOnMultiValueListFilterMatchLike() .setDimFilter(new LikeDimFilter("v0", "b%", null, null)) .setDimensions( dimensions( - new DefaultDimensionSpec("dim3", "_d0", ColumnType.STRING) + new DefaultDimensionSpec("dim3", "d0", ColumnType.STRING) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1937,7 +1937,7 @@ public void testMultiValueToArrayGroupAsArrayWithMultiValueDimension() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING_ARRAY) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING_ARRAY) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -1989,7 +1989,7 @@ public void testMultiValueToArrayGroupAsArrayWithSingleValueDim() )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING_ARRAY) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING_ARRAY) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) @@ -2045,7 +2045,7 @@ public void testMultiValueToArrayGroupAsArrayWithSingleValueDimIsNotConvertedToT )) .setDimensions( dimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING_ARRAY) + new DefaultDimensionSpec("v0", "d0", ColumnType.STRING_ARRAY) ) ) .setAggregatorSpecs(aggregators(new LongSumAggregatorFactory("a0", "cnt"))) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSelectQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSelectQueryTest.java index e053da4d7442..536ada9c6a1f 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSelectQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteSelectQueryTest.java @@ -473,7 +473,7 @@ public void testBitwiseExpressions() + "BITWISE_COMPLEMENT(l1),\n" + "BITWISE_SHIFT_LEFT(l1, 2),\n" + "BITWISE_SHIFT_RIGHT(l1, 2),\n" - + "BITWISE_CONVERT_DOUBLE_TO_LONG_BITS(d1),\n" + + "BITWISE_CONVERT_DOUBLE_TO_LONG_BITS(dbl1),\n" + "BITWISE_CONVERT_LONG_BITS_TO_DOUBLE(l1)\n" + "FROM numfoo", ImmutableList.of( @@ -488,7 +488,7 @@ public void testBitwiseExpressions() expressionVirtualColumn("v3", "bitwiseComplement(\"l1\")", ColumnType.LONG), expressionVirtualColumn("v4", "bitwiseShiftLeft(\"l1\",2)", ColumnType.LONG), expressionVirtualColumn("v5", "bitwiseShiftRight(\"l1\",2)", ColumnType.LONG), - expressionVirtualColumn("v6", "bitwiseConvertDoubleToLongBits(\"d1\")", ColumnType.LONG), + expressionVirtualColumn("v6", "bitwiseConvertDoubleToLongBits(\"dbl1\")", ColumnType.LONG), expressionVirtualColumn("v7", "bitwiseConvertLongBitsToDouble(\"l1\")", ColumnType.DOUBLE) ) .context(QUERY_CONTEXT_DEFAULT) @@ -569,7 +569,7 @@ public void testSafeDivideExpressions() "SELECT\n" + "SAFE_DIVIDE(f1, f2),\n" + "SAFE_DIVIDE(l1, l2),\n" - + "SAFE_DIVIDE(d2, d1),\n" + + "SAFE_DIVIDE(dbl2, dbl1),\n" + "SAFE_DIVIDE(l1, f1)\n" + "FROM numfoo", ImmutableList.of( @@ -580,7 +580,7 @@ public void testSafeDivideExpressions() .virtualColumns( expressionVirtualColumn("v0", "safe_divide(\"f1\",\"f2\")", ColumnType.FLOAT), expressionVirtualColumn("v1", "safe_divide(\"l1\",\"l2\")", ColumnType.LONG), - expressionVirtualColumn("v2", "safe_divide(\"d2\",\"d1\")", ColumnType.DOUBLE), + expressionVirtualColumn("v2", "safe_divide(\"dbl2\",\"dbl1\")", ColumnType.DOUBLE), expressionVirtualColumn("v3", "safe_divide(\"l1\",\"f1\")", ColumnType.FLOAT) ) .context(QUERY_CONTEXT_DEFAULT) @@ -2105,7 +2105,7 @@ public void testCacheKeyConsistency() // possibly pollute the cache // https://github.com/apache/druid/issues/16552 testBuilder() - .sql("select dim1,d1 from numfoo where 0.0 < d1 and d1 < 1.25 group by dim1,d1") + .sql("select dim1,dbl1 from numfoo where 0.0 < dbl1 and dbl1 < 1.25 group by dim1,dbl1") .expectedResults( ImmutableList.of( new Object[] {"", 1.0D} @@ -2114,7 +2114,7 @@ public void testCacheKeyConsistency() .run(); testBuilder() - .sql("select dim1,d1 from numfoo where 0.0 < d1 and d1 < 1.75 group by dim1,d1") + .sql("select dim1,dbl1 from numfoo where 0.0 < dbl1 and dbl1 < 1.75 group by dim1,dbl1") .expectedResults( ImmutableList.of( new Object[] {"", 1.0D}, diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java index 02b8787df233..d99797fd9d2c 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java @@ -82,14 +82,14 @@ public void testUnion() public void testAppend2() { testBuilder() - .sql("select dim1,dim4,d1,f1 from TABLE(APPEND('foo','numfoo')) u") + .sql("select dim1,dim4,dbl1,f1 from TABLE(APPEND('foo','numfoo')) u") .expectedQuery( Druids.newScanQueryBuilder() .dataSource( unionDataSource(CalciteTests.DATASOURCE1, CalciteTests.DATASOURCE3) ) .intervals(querySegmentSpec(Filtration.eternity())) - .columns("d1", "dim1", "dim4", "f1") + .columns("dbl1", "dim1", "dim4", "f1") .context(QUERY_CONTEXT_DEFAULT) .resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .build() @@ -123,14 +123,14 @@ public void testAppend2() public void testAppendSameTableMultipleTimes() { testBuilder() - .sql("select dim1,dim4,d1,f1 from TABLE(APPEND('foo','numfoo','foo')) u where dim1='2'") + .sql("select dim1,dim4,dbl1,f1 from TABLE(APPEND('foo','numfoo','foo')) u where dim1='2'") .expectedQuery( Druids.newScanQueryBuilder() .dataSource( unionDataSource(CalciteTests.DATASOURCE1, CalciteTests.DATASOURCE3, CalciteTests.DATASOURCE1) ) .intervals(querySegmentSpec(Filtration.eternity())) - .columns("d1", "dim1", "dim4", "f1") + .columns("dbl1", "dim1", "dim4", "f1") .context(QUERY_CONTEXT_DEFAULT) .resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .filters(equality("dim1", "2", ColumnType.STRING)) From ced72b3ab7514f7aa91c8da48438790ef4680728 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 14:40:12 +0000 Subject: [PATCH 22/99] fix nondefault --- .../java/org/apache/druid/sql/calcite/CalciteQueryTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 9a4a48b7233f..27b10d0491cd 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -1775,7 +1775,7 @@ public void testFirstLatestAggregatorsSkipNulls() filter = and( notNull("dim1"), notNull("l1"), - notNull("d1"), + notNull("dbl1"), notNull("f1") ); } @@ -5004,7 +5004,7 @@ public void testSimpleAggregations() ), new FilteredAggregatorFactory( new CountAggregatorFactory("a8"), - notNull("d1") + notNull("dbl1") ), new DoubleSumAggregatorFactory("a9:sum", "dbl1"), new FilteredAggregatorFactory( @@ -10729,7 +10729,7 @@ public void testGroupByAggregatorDefaultValues() : new FilteredAggregatorFactory( new CountAggregatorFactory("a10:count"), and( - notNull("d1"), + notNull("dbl1"), equality("dim1", "nonexistent", ColumnType.STRING) ) ) From fc31c8a84aaaa26351ff5b2827d9fea3b98a9409 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 14:51:56 +0000 Subject: [PATCH 23/99] update iq files --- .../testUnnestExtractionFn@NullHandling=default.iq | 4 ++-- .../testUnnestExtractionFn@NullHandling=sql.iq | 4 ++-- .../testUnnestWithFilters@NullHandling=default.iq | 6 +++--- .../testUnnestWithFilters@NullHandling=sql.iq | 6 +++--- ...nnestWithFiltersInsideAndOutside@NullHandling=default.iq | 6 +++--- ...estUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq | 6 +++--- ...ersOnVariationsOfUnnestedColumns@NullHandling=default.iq | 4 ++-- ...FiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq | 4 ++-- ...stWithNotFiltersOnUnnestedColumn@NullHandling=default.iq | 4 ++-- ...UnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq | 4 ++-- ...estExactTopNOnInnerJoinWithLimit@NullHandling=default.iq | 4 ++-- .../testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq | 4 ++-- ...stGroupByLimitPushdownExtraction@NullHandling=default.iq | 2 +- .../testGroupByLimitPushdownExtraction@NullHandling=sql.iq | 2 +- .../testGroupByWithLiteralInSubqueryGrouping.iq | 6 +++--- 15 files changed, 33 insertions(+), 33 deletions(-) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq index bf46154190aa..b0328f4db531 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq @@ -22,13 +22,13 @@ SELECT substring(d3,1) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested !ok LogicalProject(EXPR$0=[SUBSTRING($18, 1)]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>(SUBSTRING($0, 1), 'b')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(EXPR$0=[SUBSTRING($18, 1)], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>(SUBSTRING($0, 1), 'b')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq index 57ce98e52b5e..b0b5281a5cc9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq @@ -22,13 +22,13 @@ SELECT substring(d3,1) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested !ok LogicalProject(EXPR$0=[SUBSTRING($18, 1)]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>(SUBSTRING($0, 1), 'b')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(EXPR$0=[SUBSTRING($18, 1)], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>(SUBSTRING($0, 1), 'b')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq index 64963f6fc241..19f2e31bb4d8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq @@ -21,14 +21,14 @@ SELECT d3 FROM (select * from druid.numfoo where dim2='a'), UNNEST(MV_TO_ARRAY(d !ok LogicalProject(d3=[$18]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)]) - LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) + LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) LogicalFilter(condition=[=($2, 'a')]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(d3=[$18], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)]) - DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) DruidFilter(condition=[=($2, 'a')]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -61,7 +61,7 @@ DruidProject(d3=[$18], druid=[logical]) "dimension" : "dim2", "value" : "a" }, - "columns" : [ "__time", "cnt", "d1", "d2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], + "columns" : [ "__time", "cnt", "dbl1", "dbl2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], "columnTypes" : [ "LONG", "LONG", "DOUBLE", "DOUBLE", "STRING", "STRING", "STRING", "STRING", "STRING", "FLOAT", "FLOAT", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX", "STRING" ], "granularity" : { "type" : "all" diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq index f032fc5c14d8..2186f06708f5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq @@ -22,14 +22,14 @@ SELECT d3 FROM (select * from druid.numfoo where dim2='a'), UNNEST(MV_TO_ARRAY(d !ok LogicalProject(d3=[$18]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)]) - LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) + LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) LogicalFilter(condition=[=($2, 'a')]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(d3=[$18], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)]) - DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) DruidFilter(condition=[=($2, 'a')]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -63,7 +63,7 @@ DruidProject(d3=[$18], druid=[logical]) "matchValueType" : "STRING", "matchValue" : "a" }, - "columns" : [ "__time", "cnt", "d1", "d2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], + "columns" : [ "__time", "cnt", "dbl1", "dbl2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], "columnTypes" : [ "LONG", "LONG", "DOUBLE", "DOUBLE", "STRING", "STRING", "STRING", "STRING", "STRING", "FLOAT", "FLOAT", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX", "STRING" ], "granularity" : { "type" : "all" diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq index ca22c18ff45f..906451e419a6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq @@ -24,14 +24,14 @@ AND unnested.d3 <> 'b'; !ok LogicalProject(d3=[$18]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'b')]) - LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) + LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) LogicalFilter(condition=[AND(=($2, 'a'), <>($1, 'foo'))]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(d3=[$18], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'b')]) - DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) DruidFilter(condition=[AND(=($2, 'a'), <>($1, 'foo'))]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -74,7 +74,7 @@ DruidProject(d3=[$18], druid=[logical]) } } ] }, - "columns" : [ "__time", "cnt", "d1", "d2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], + "columns" : [ "__time", "cnt", "dbl1", "dbl2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], "columnTypes" : [ "LONG", "LONG", "DOUBLE", "DOUBLE", "STRING", "STRING", "STRING", "STRING", "STRING", "FLOAT", "FLOAT", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX", "STRING" ], "granularity" : { "type" : "all" diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq index 45c21b71c3f4..f4785a9a3f4d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq @@ -25,14 +25,14 @@ AND unnested.d3 <> 'b'; !ok LogicalProject(d3=[$18]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'b')]) - LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) + LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) LogicalFilter(condition=[AND(=($2, 'a'), <>($1, 'foo'))]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(d3=[$18], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'b')]) - DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) DruidFilter(condition=[AND(=($2, 'a'), <>($1, 'foo'))]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -77,7 +77,7 @@ DruidProject(d3=[$18], druid=[logical]) } } ] }, - "columns" : [ "__time", "cnt", "d1", "d2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], + "columns" : [ "__time", "cnt", "dbl1", "dbl2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], "columnTypes" : [ "LONG", "LONG", "DOUBLE", "DOUBLE", "STRING", "STRING", "STRING", "STRING", "STRING", "FLOAT", "FLOAT", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX", "STRING" ], "granularity" : { "type" : "all" diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq index 4f12b5750dca..616ce8399831 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq @@ -24,13 +24,13 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where st !ok LogicalProject(d3=[$18]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(d3=[$18], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq index e5d8a68baf69..0a2bec94e338 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq @@ -25,13 +25,13 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where st !ok LogicalProject(d3=[$18]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(d3=[$18], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq index 84d0c9b478e7..0b63ec6fcb99 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq @@ -23,13 +23,13 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3 !ok LogicalProject(d3=[$18]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'd')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(d3=[$18], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'd')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq index bc027187606b..7b7bf5eecff0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq @@ -24,13 +24,13 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3 !ok LogicalProject(d3=[$18]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'd')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(d3=[$18], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'd')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq index 655e998e70c9..d2f2548b675a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq @@ -74,7 +74,7 @@ DruidSort(fetch=[1], druid=[logical]) "dimensions" : [ { "type" : "default", "dimension" : "dim4", - "outputName" : "_d0", + "outputName" : "d0", "outputType" : "STRING" } ], "limitSpec" : { @@ -83,7 +83,7 @@ DruidSort(fetch=[1], druid=[logical]) } }, "rightPrefix" : "j0.", - "condition" : "(\"dim4\" == \"j0._d0\")", + "condition" : "(\"dim4\" == \"j0.d0\")", "joinType" : "INNER" }, "dimension" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq index f7f6ae51c54e..89919ef819ae 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq @@ -75,7 +75,7 @@ DruidSort(fetch=[1], druid=[logical]) "dimensions" : [ { "type" : "default", "dimension" : "dim4", - "outputName" : "_d0", + "outputName" : "d0", "outputType" : "STRING" } ], "limitSpec" : { @@ -84,7 +84,7 @@ DruidSort(fetch=[1], druid=[logical]) } }, "rightPrefix" : "j0.", - "condition" : "(\"dim4\" == \"j0._d0\")", + "condition" : "(\"dim4\" == \"j0.d0\")", "joinType" : "INNER" }, "dimension" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq index a7a5d16f35ec..ee8ff3e4ed42 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq @@ -43,7 +43,7 @@ DruidProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1], druid=[ "dimension" : { "type" : "extraction", "dimension" : "dim5", - "outputName" : "_d0", + "outputName" : "d0", "outputType" : "STRING", "extractionFn" : { "type" : "substring", diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq index e6c589194f76..1f49a1cb53ee 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq @@ -43,7 +43,7 @@ DruidProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1], druid=[ "dimension" : { "type" : "extraction", "dimension" : "dim5", - "outputName" : "_d0", + "outputName" : "d0", "outputType" : "STRING", "extractionFn" : { "type" : "substring", diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq index b5d2c682643b..da905b0336c1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq @@ -70,7 +70,7 @@ DruidProject(t1=['dummy'], t2=[$0], druid=[logical]) "dimensions" : [ { "type" : "default", "dimension" : "dim4", - "outputName" : "_d0", + "outputName" : "d0", "outputType" : "STRING" } ], "limitSpec" : { @@ -85,7 +85,7 @@ DruidProject(t1=['dummy'], t2=[$0], druid=[logical]) "virtualColumns" : [ { "type" : "expression", "name" : "v0", - "expression" : "case_searched((\"_d0\" == 'b'),\"_d0\",null)", + "expression" : "case_searched((\"d0\" == 'b'),\"d0\",null)", "outputType" : "STRING" } ], "granularity" : { @@ -94,7 +94,7 @@ DruidProject(t1=['dummy'], t2=[$0], druid=[logical]) "dimensions" : [ { "type" : "default", "dimension" : "v0", - "outputName" : "d0", + "outputName" : "_d0", "outputType" : "STRING" } ], "postAggregations" : [ { From 247ee17f17f1d47b1e38d3a435a5a67ea0452cc3 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 15:35:00 +0000 Subject: [PATCH 24/99] fixups after merge --- .../apache/druid/sql/calcite/CalciteArraysQueryTest.java | 8 ++++---- .../apache/druid/sql/calcite/CalciteTableAppendTest.java | 4 ++-- .../testUnnestWithFilters@NullHandling=default.iq | 3 +-- .../testUnnestWithFilters@NullHandling=sql.iq | 3 +-- ...estWithFiltersInsideAndOutside@NullHandling=default.iq | 3 +-- ...tUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq | 3 +-- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index e0690933cf6f..9d5eaf51a887 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -338,8 +338,8 @@ public void testSomeArrayFunctionsWithScanQuery() .add("dim3", ColumnType.STRING) .add("l1", ColumnType.LONG) .add("l2", ColumnType.LONG) - .add("d1", ColumnType.DOUBLE) - .add("d2", ColumnType.DOUBLE) + .add("dbl1", ColumnType.DOUBLE) + .add("dbl2", ColumnType.DOUBLE) .add("EXPR$7", ColumnType.STRING_ARRAY) .add("EXPR$8", ColumnType.LONG_ARRAY) .add("EXPR$9", ColumnType.DOUBLE_ARRAY) @@ -417,8 +417,8 @@ public void testSomeArrayFunctionsWithScanQuery() "dim3", "l1", "l2", - "d1", - "d2", + "dbl1", + "dbl2", "v0", "v1", "v2", diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java index 6340b91fcd6f..41738d85753a 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteTableAppendTest.java @@ -91,7 +91,7 @@ public void testAppend2() unionDataSource(CalciteTests.DATASOURCE1, CalciteTests.DATASOURCE3) ) .intervals(querySegmentSpec(Filtration.eternity())) - .columns("dim1", "dim4", "d1", "f1") + .columns("dim1", "dim4", "dbl1", "f1") .columnTypes(ColumnType.STRING, ColumnType.STRING, ColumnType.DOUBLE, ColumnType.FLOAT) .context(QUERY_CONTEXT_DEFAULT) .resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST) @@ -133,7 +133,7 @@ public void testAppendSameTableMultipleTimes() unionDataSource(CalciteTests.DATASOURCE1, CalciteTests.DATASOURCE3, CalciteTests.DATASOURCE1) ) .intervals(querySegmentSpec(Filtration.eternity())) - .columns("dim1", "dim4", "d1", "f1") + .columns("dim1", "dim4", "dbl1", "f1") .columnTypes(ColumnType.STRING, ColumnType.STRING, ColumnType.DOUBLE, ColumnType.FLOAT) .context(QUERY_CONTEXT_DEFAULT) .resultFormat(ResultFormat.RESULT_FORMAT_COMPACTED_LIST) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq index 6a558728c7aa..9356c032797c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq @@ -61,8 +61,7 @@ DruidProject(d3=[$18], druid=[logical]) "dimension" : "dim2", "value" : "a" }, - "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "d1", "d2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], - "columns" : [ "__time", "cnt", "dbl1", "dbl2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], + "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "dbl1", "dbl2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "DOUBLE", "DOUBLE", "FLOAT", "FLOAT", "LONG", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], "granularity" : { "type" : "all" diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq index 973c0e5b9cca..19a176b8f82b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq @@ -63,8 +63,7 @@ DruidProject(d3=[$18], druid=[logical]) "matchValueType" : "STRING", "matchValue" : "a" }, - "columns" : [ "__time", "cnt", "dbl1", "dbl2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], - "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "d1", "d2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], + "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "dbl1", "dbl2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "DOUBLE", "DOUBLE", "FLOAT", "FLOAT", "LONG", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], "granularity" : { "type" : "all" diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq index eda35b9ed673..97b2692b1045 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq @@ -74,8 +74,7 @@ DruidProject(d3=[$18], druid=[logical]) } } ] }, - "columns" : [ "__time", "cnt", "dbl1", "dbl2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], - "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "d1", "d2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], + "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "dbl1", "dbl2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "DOUBLE", "DOUBLE", "FLOAT", "FLOAT", "LONG", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], "granularity" : { "type" : "all" diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq index 44b674f7141c..a335a370acd8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq @@ -77,8 +77,7 @@ DruidProject(d3=[$18], druid=[logical]) } } ] }, - "columns" : [ "__time", "cnt", "dbl1", "dbl2", "dim1", "dim3", "dim4", "dim5", "dim6", "f1", "f2", "l1", "l2", "m1", "m2", "unique_dim1", "v0" ], - "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "d1", "d2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], + "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "dbl1", "dbl2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "DOUBLE", "DOUBLE", "FLOAT", "FLOAT", "LONG", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], "granularity" : { "type" : "all" From 8dfd57f922a089b1180ca42dad8049d925a17077 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 16:30:08 +0000 Subject: [PATCH 25/99] update test --- .../org/apache/druid/sql/calcite/CalciteArraysQueryTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 6b62acb1408e..975a80fff2ec 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -6914,7 +6914,8 @@ public void testUnnestWithTimeFilterOnlyNestedIsBad0() .intervals(querySegmentSpec(Intervals.of("2000-01-02T00:00:00.000Z/2000-01-03T00:10:00.001Z"))) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_UNNEST) - .columns(ImmutableList.of("_j0.unnest", "j0.unnest")) + .columns(ImmutableList.of("j0.unnest", "_j0.unnest")) + .columnTypes(ColumnType.FLOAT, ColumnType.STRING) .build() ), ImmutableList.of( @@ -6952,6 +6953,7 @@ public void testUnnestWithTimeFilterOnlyNestedIsBad() .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_UNNEST) .columns(ImmutableList.of("j0.unnest")) + .columnTypes(ColumnType.FLOAT) .build() ), ImmutableList.of( From 0d09c18cab839b1ea62132701d0825ef89fbfff3 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 16:48:31 +0000 Subject: [PATCH 26/99] undo trials; re-introduce expr if needed (will be trimmed in most cases) --- .../org/apache/druid/math/expr/Function.java | 25 ------- .../RuntimeAssertOperatorConversion.java | 65 ------------------- .../calcite/planner/DruidOperatorTable.java | 2 - .../rule/logical/UnnestInputCleanupRule.java | 45 +------------ .../sql/calcite/CalciteArraysQueryTest.java | 2 +- 5 files changed, 3 insertions(+), 136 deletions(-) delete mode 100644 sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RuntimeAssertOperatorConversion.java diff --git a/processing/src/main/java/org/apache/druid/math/expr/Function.java b/processing/src/main/java/org/apache/druid/math/expr/Function.java index 509d7b9d8a6a..a4171cc8b35c 100644 --- a/processing/src/main/java/org/apache/druid/math/expr/Function.java +++ b/processing/src/main/java/org/apache/druid/math/expr/Function.java @@ -4341,29 +4341,4 @@ protected HumanReadableBytes.UnitSystem getUnitSystem() return HumanReadableBytes.UnitSystem.DECIMAL; } } - - class RuntimeAssert extends UnivariateFunction - { - public static final String NAME = "assert"; - - @Override - public String name() - { - return NAME; - } - - @Nullable - @Override - public ExpressionType getOutputType(Expr.InputBindingInspector inspector, List args) - { - return ExpressionType.STRING; - } - - @Override - protected ExprEval eval(ExprEval param) - { - throw DruidException.defensive("Runtime assertion: " + param.asString()); - } - } - } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RuntimeAssertOperatorConversion.java b/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RuntimeAssertOperatorConversion.java deleted file mode 100644 index f24565803e9f..000000000000 --- a/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/RuntimeAssertOperatorConversion.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.sql.calcite.expression.builtin; - -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.sql.SqlFunction; -import org.apache.calcite.sql.SqlFunctionCategory; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.type.OperandTypes; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.druid.java.util.common.StringUtils; -import org.apache.druid.math.expr.Function; -import org.apache.druid.segment.column.RowSignature; -import org.apache.druid.sql.calcite.expression.DruidExpression; -import org.apache.druid.sql.calcite.expression.OperatorConversions; -import org.apache.druid.sql.calcite.expression.SqlOperatorConversion; -import org.apache.druid.sql.calcite.planner.PlannerContext; - -public class RuntimeAssertOperatorConversion implements SqlOperatorConversion -{ - private final SqlFunction sqlFunction; - - public RuntimeAssertOperatorConversion() - { - this.sqlFunction = OperatorConversions - .operatorBuilder(StringUtils.toUpperCase(Function.RuntimeAssert.NAME)) - .operandTypeChecker(OperandTypes.ANY) - .functionCategory(SqlFunctionCategory.SYSTEM) - .returnTypeNullable(SqlTypeName.ANY) - .build(); - } - - @Override - public SqlOperator calciteOperator() - { - return sqlFunction; - } - - @Override - public DruidExpression toDruidExpression( - final PlannerContext plannerContext, - final RowSignature rowSignature, - final RexNode rexNode - ) - { - return OperatorConversions.convertDirectCall(plannerContext, rowSignature, rexNode, Function.RuntimeAssert.NAME); - } -} diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidOperatorTable.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidOperatorTable.java index 4b5659e489cd..0fb1c9fb9ff0 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidOperatorTable.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidOperatorTable.java @@ -110,7 +110,6 @@ import org.apache.druid.sql.calcite.expression.builtin.RepeatOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.ReverseOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.RightOperatorConversion; -import org.apache.druid.sql.calcite.expression.builtin.RuntimeAssertOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.SafeDivideOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.ScalarInArrayOperatorConversion; import org.apache.druid.sql.calcite.expression.builtin.SearchOperatorConversion; @@ -433,7 +432,6 @@ public class DruidOperatorTable implements SqlOperatorTable .addAll(CUSTOM_MATH_OPERATOR_CONVERSIONS) .addAll(NESTED_DATA_OPERATOR_CONVERSIONS) .add(TableAppendMacro.OPERATOR_CONVERSION) - .add(new RuntimeAssertOperatorConversion()) .build(); // Operators that have no conversion, but are handled in the convertlet table, so they still need to exist. diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index 10784f6a61e5..80554c0ff45b 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -19,7 +19,6 @@ package org.apache.druid.sql.calcite.rule.logical; -import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import org.apache.calcite.plan.RelOptRule; import org.apache.calcite.plan.RelOptRuleCall; @@ -28,19 +27,14 @@ import org.apache.calcite.rel.core.Project; import org.apache.calcite.rel.rules.SubstitutionRule; import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.rex.RexBuilder; import org.apache.calcite.rex.RexInputRef; import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexShuttle; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.tools.RelBuilder; import org.apache.calcite.util.ImmutableBitSet; import org.apache.druid.error.DruidException; -import org.apache.druid.sql.calcite.expression.builtin.RuntimeAssertOperatorConversion; - import java.util.ArrayList; -import java.util.Collections; import java.util.List; /** @@ -110,10 +104,6 @@ public void onMatch(RelOptRuleCall call) .build(); -// new RelRecordType( -// -// ); - RelNode newUnnest = new LogicalUnnest( unnest.getCluster(), unnest.getTraitSet(), @@ -133,48 +123,17 @@ public void onMatch(RelOptRuleCall call) // return; } for (int i = 0; i < hideCount; i++) { - projectFields.remove(unnest.getRowType().getFieldCount()-2); + projectFields.remove(unnest.getRowType().getFieldCount() - 2); } RelDataType type = oldProject.getProjects().get(inputIndex).getType(); - RexNode rn; - if(type.isNullable()) { - rn = rexBuilder.makeNullLiteral(type); - } else { - // bail out -// return; -// reutrn; - rn=null; - int i=4; - if(i==1) { - rn =rexBuilder.makeReinterpretCast(type, rexBuilder.makeNullLiteral(type), null); - } - if(i==2) { - rn =rexBuilder.makeAbstractCast(type, rexBuilder.makeNullLiteral(type), true); - } - - if(i==3) { - rn = rexBuilder.makeCall(type, SqlStdOperatorTable.CURRENT_TIMESTAMP, Collections.emptyList()); - } - if(i==4) { - rn = rexBuilder.makeCall( - type, - new RuntimeAssertOperatorConversion().calciteOperator(), - ImmutableList.of(rexBuilder.makeLiteral("Not possible to access the unnested function's input")) - ); - } - } projectFields.set( inputIndex, - rn + newUnnestExpr ); builder.project(projectFields, ImmutableSet.of() , true); RelNode build = builder.build(); - RelDataTypeField newField = build.getRowType().getFieldList().get(inputIndex); - if(newField.getType().isNullable() != type.isNullable()) { - int asd = 1; - } call.transformTo(build); call.getPlanner().prune(unnest); } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 975a80fff2ec..4b5bc28d26ad 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -6894,7 +6894,7 @@ public void testQuery1( public void testUnnestWithTimeFilterOnlyNestedIsBad0() { testQuery1( - "select d,c from foo CROSS JOIN UNNEST(ARRAY[m1,m2]) as un(d) CROSS JOIN unnest(MV_TO_ARRAY(dim3)) as u(c)" + "select d,c,ARRAY[m1,m2] from foo CROSS JOIN UNNEST(ARRAY[m1,m2]) as un(d) CROSS JOIN unnest(MV_TO_ARRAY(dim3)) as u(c)" + " where __time >= TIMESTAMP '2000-01-02 00:00:00' and __time <= TIMESTAMP '2000-01-03 00:10:00'", QUERY_CONTEXT_UNNEST, ImmutableList.of( From 96f572e6791722ede88f6928c81f7c39327a62df Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 17:03:06 +0000 Subject: [PATCH 27/99] updates/etc --- .../sql/calcite/BaseCalciteQueryTest.java | 12 ++++ .../sql/calcite/CalciteArraysQueryTest.java | 7 +-- .../druid/sql/calcite/CalciteQueryTest.java | 1 - ...UnnestExtractionFn@NullHandling=default.iq | 12 ++-- ...testUnnestExtractionFn@NullHandling=sql.iq | 12 ++-- ...hFiltersInnerLimit@NullHandling=default.iq | 32 +++++------ ...tWithFiltersInnerLimit@NullHandling=sql.iq | 32 +++++------ ...sOfUnnestedColumns@NullHandling=default.iq | 12 ++-- ...tionsOfUnnestedColumns@NullHandling=sql.iq | 12 ++-- ...rsOnUnnestedColumn@NullHandling=default.iq | 12 ++-- ...iltersOnUnnestedColumn@NullHandling=sql.iq | 12 ++-- ...InnerJoinWithLimit@NullHandling=default.iq | 14 +++-- ...pNOnInnerJoinWithLimit@NullHandling=sql.iq | 14 +++-- ...urces@all_disabled@NullHandling=default.iq | 14 +++-- ...taSources@all_disabled@NullHandling=sql.iq | 14 +++-- ...ources@all_enabled@NullHandling=default.iq | 14 +++-- ...ataSources@all_enabled@NullHandling=sql.iq | 14 +++-- ...ataSources@default@NullHandling=default.iq | 14 +++-- ...ineDataSources@default@NullHandling=sql.iq | 14 +++-- ...ue-column_disabled@NullHandling=default.iq | 14 +++-- ...-value-column_disabled@NullHandling=sql.iq | 14 +++-- ...-rewrites-disabled@NullHandling=default.iq | 14 +++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 +++-- ...es@filter-rewrites@NullHandling=default.iq | 14 +++-- ...ources@filter-rewrites@NullHandling=sql.iq | 14 +++-- ...ces@join-to-filter@NullHandling=default.iq | 14 +++-- ...Sources@join-to-filter@NullHandling=sql.iq | 14 +++-- ...ccess@all_disabled@NullHandling=default.iq | 14 +++-- ...ectAccess@all_disabled@NullHandling=sql.iq | 14 +++-- ...Access@all_enabled@NullHandling=default.iq | 14 +++-- ...rectAccess@all_enabled@NullHandling=sql.iq | 14 +++-- ...rectAccess@default@NullHandling=default.iq | 14 +++-- ...ftDirectAccess@default@NullHandling=sql.iq | 14 +++-- ...ue-column_disabled@NullHandling=default.iq | 14 +++-- ...-value-column_disabled@NullHandling=sql.iq | 14 +++-- ...-rewrites-disabled@NullHandling=default.iq | 14 +++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 +++-- ...ss@filter-rewrites@NullHandling=default.iq | 14 +++-- ...Access@filter-rewrites@NullHandling=sql.iq | 14 +++-- ...ess@join-to-filter@NullHandling=default.iq | 14 +++-- ...tAccess@join-to-filter@NullHandling=sql.iq | 14 +++-- ...ccess@all_disabled@NullHandling=default.iq | 14 +++-- ...ectAccess@all_disabled@NullHandling=sql.iq | 14 +++-- ...Access@all_enabled@NullHandling=default.iq | 14 +++-- ...rectAccess@all_enabled@NullHandling=sql.iq | 14 +++-- ...rectAccess@default@NullHandling=default.iq | 14 +++-- ...ftDirectAccess@default@NullHandling=sql.iq | 14 +++-- ...ue-column_disabled@NullHandling=default.iq | 14 +++-- ...-value-column_disabled@NullHandling=sql.iq | 14 +++-- ...-rewrites-disabled@NullHandling=default.iq | 14 +++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 +++-- ...ss@filter-rewrites@NullHandling=default.iq | 14 +++-- ...Access@filter-rewrites@NullHandling=sql.iq | 14 +++-- ...ess@join-to-filter@NullHandling=default.iq | 14 +++-- ...tAccess@join-to-filter@NullHandling=sql.iq | 14 +++-- ...iesWithFloorOnTime@NullHandling=default.iq | 14 +++-- ...eseriesWithFloorOnTime@NullHandling=sql.iq | 14 +++-- ...gateMultipleValues@NullHandling=default.iq | 14 +++-- ...ggregateMultipleValues@NullHandling=sql.iq | 14 +++-- ...iesWithFloorOnTime@NullHandling=default.iq | 14 +++-- ...eseriesWithFloorOnTime@NullHandling=sql.iq | 14 +++-- ...hInputRefCondition@NullHandling=default.iq | 51 +++++------------ ...nWithInputRefCondition@NullHandling=sql.iq | 57 ++++++------------- ...ccess@all_disabled@NullHandling=default.iq | 14 +++-- ...ectAccess@all_disabled@NullHandling=sql.iq | 14 +++-- ...Access@all_enabled@NullHandling=default.iq | 14 +++-- ...rectAccess@all_enabled@NullHandling=sql.iq | 14 +++-- ...rectAccess@default@NullHandling=default.iq | 14 +++-- ...ftDirectAccess@default@NullHandling=sql.iq | 14 +++-- ...ue-column_disabled@NullHandling=default.iq | 14 +++-- ...-value-column_disabled@NullHandling=sql.iq | 14 +++-- ...-rewrites-disabled@NullHandling=default.iq | 14 +++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 +++-- ...ss@filter-rewrites@NullHandling=default.iq | 14 +++-- ...Access@filter-rewrites@NullHandling=sql.iq | 14 +++-- ...ess@join-to-filter@NullHandling=default.iq | 14 +++-- ...tAccess@join-to-filter@NullHandling=sql.iq | 14 +++-- ...ccess@all_disabled@NullHandling=default.iq | 12 ++-- ...ectAccess@all_disabled@NullHandling=sql.iq | 12 ++-- ...Access@all_enabled@NullHandling=default.iq | 12 ++-- ...rectAccess@all_enabled@NullHandling=sql.iq | 12 ++-- ...rectAccess@default@NullHandling=default.iq | 12 ++-- ...ftDirectAccess@default@NullHandling=sql.iq | 12 ++-- ...ue-column_disabled@NullHandling=default.iq | 12 ++-- ...-value-column_disabled@NullHandling=sql.iq | 12 ++-- ...-rewrites-disabled@NullHandling=default.iq | 12 ++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 12 ++-- ...ss@filter-rewrites@NullHandling=default.iq | 12 ++-- ...Access@filter-rewrites@NullHandling=sql.iq | 12 ++-- ...ess@join-to-filter@NullHandling=default.iq | 12 ++-- ...tAccess@join-to-filter@NullHandling=sql.iq | 12 ++-- ...ccess@all_disabled@NullHandling=default.iq | 14 +++-- ...ectAccess@all_disabled@NullHandling=sql.iq | 14 +++-- ...Access@all_enabled@NullHandling=default.iq | 14 +++-- ...rectAccess@all_enabled@NullHandling=sql.iq | 14 +++-- ...rectAccess@default@NullHandling=default.iq | 14 +++-- ...ftDirectAccess@default@NullHandling=sql.iq | 14 +++-- ...ue-column_disabled@NullHandling=default.iq | 14 +++-- ...-value-column_disabled@NullHandling=sql.iq | 14 +++-- ...-rewrites-disabled@NullHandling=default.iq | 14 +++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 +++-- ...ss@filter-rewrites@NullHandling=default.iq | 14 +++-- ...Access@filter-rewrites@NullHandling=sql.iq | 14 +++-- ...ess@join-to-filter@NullHandling=default.iq | 14 +++-- ...tAccess@join-to-filter@NullHandling=sql.iq | 14 +++-- ...ilter@all_disabled@NullHandling=default.iq | 20 ++++--- ...ithFilter@all_disabled@NullHandling=sql.iq | 20 ++++--- ...Filter@all_enabled@NullHandling=default.iq | 20 ++++--- ...WithFilter@all_enabled@NullHandling=sql.iq | 20 ++++--- ...WithFilter@default@NullHandling=default.iq | 20 ++++--- ...urceWithFilter@default@NullHandling=sql.iq | 20 ++++--- ...ue-column_disabled@NullHandling=default.iq | 20 ++++--- ...-value-column_disabled@NullHandling=sql.iq | 20 ++++--- ...-rewrites-disabled@NullHandling=default.iq | 20 ++++--- ...lter-rewrites-disabled@NullHandling=sql.iq | 20 ++++--- ...er@filter-rewrites@NullHandling=default.iq | 20 ++++--- ...Filter@filter-rewrites@NullHandling=sql.iq | 20 ++++--- ...ter@join-to-filter@NullHandling=default.iq | 20 ++++--- ...hFilter@join-to-filter@NullHandling=sql.iq | 20 ++++--- ...Joins@all_disabled@NullHandling=default.iq | 12 ++-- ...icitJoins@all_disabled@NullHandling=sql.iq | 12 ++-- ...tJoins@all_enabled@NullHandling=default.iq | 12 ++-- ...licitJoins@all_enabled@NullHandling=sql.iq | 12 ++-- ...licitJoins@default@NullHandling=default.iq | 12 ++-- ...gExplicitJoins@default@NullHandling=sql.iq | 12 ++-- ...ue-column_disabled@NullHandling=default.iq | 12 ++-- ...-value-column_disabled@NullHandling=sql.iq | 12 ++-- ...-rewrites-disabled@NullHandling=default.iq | 12 ++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 12 ++-- ...ns@filter-rewrites@NullHandling=default.iq | 12 ++-- ...tJoins@filter-rewrites@NullHandling=sql.iq | 12 ++-- ...ins@join-to-filter@NullHandling=default.iq | 12 ++-- ...itJoins@join-to-filter@NullHandling=sql.iq | 12 ++-- ...query@all_disabled@NullHandling=default.iq | 18 ++++-- ...nSubquery@all_disabled@NullHandling=sql.iq | 18 ++++-- ...bquery@all_enabled@NullHandling=default.iq | 18 ++++-- ...InSubquery@all_enabled@NullHandling=sql.iq | 18 ++++-- ...InSubquery@default@NullHandling=default.iq | 18 ++++-- ...hereInSubquery@default@NullHandling=sql.iq | 18 ++++-- ...ue-column_disabled@NullHandling=default.iq | 18 ++++-- ...-value-column_disabled@NullHandling=sql.iq | 18 ++++-- ...-rewrites-disabled@NullHandling=default.iq | 18 ++++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 18 ++++-- ...ry@filter-rewrites@NullHandling=default.iq | 18 ++++-- ...bquery@filter-rewrites@NullHandling=sql.iq | 18 ++++-- ...ery@join-to-filter@NullHandling=default.iq | 18 ++++-- ...ubquery@join-to-filter@NullHandling=sql.iq | 18 ++++-- ...gregateWithOrderBy@NullHandling=default.iq | 14 +++-- ...ctAggregateWithOrderBy@NullHandling=sql.iq | 14 +++-- ...terTimeExtractScan@NullHandling=default.iq | 14 +++-- ...thOuterTimeExtractScan@NullHandling=sql.iq | 14 +++-- ...ously@all_disabled@NullHandling=default.iq | 20 ++++--- ...taneously@all_disabled@NullHandling=sql.iq | 20 ++++--- ...eously@all_enabled@NullHandling=default.iq | 20 ++++--- ...ltaneously@all_enabled@NullHandling=sql.iq | 20 ++++--- ...ltaneously@default@NullHandling=default.iq | 20 ++++--- ...Simultaneously@default@NullHandling=sql.iq | 20 ++++--- ...ue-column_disabled@NullHandling=default.iq | 20 ++++--- ...-value-column_disabled@NullHandling=sql.iq | 20 ++++--- ...-rewrites-disabled@NullHandling=default.iq | 20 ++++--- ...lter-rewrites-disabled@NullHandling=sql.iq | 20 ++++--- ...ly@filter-rewrites@NullHandling=default.iq | 20 ++++--- ...eously@filter-rewrites@NullHandling=sql.iq | 20 ++++--- ...sly@join-to-filter@NullHandling=default.iq | 20 ++++--- ...neously@join-to-filter@NullHandling=sql.iq | 20 ++++--- ...lTwoQueriesLeftQueryIsJoin@all_disabled.iq | 10 ++-- ...llTwoQueriesLeftQueryIsJoin@all_enabled.iq | 10 ++-- ...ionAllTwoQueriesLeftQueryIsJoin@default.iq | 10 ++-- ...yIsJoin@filter-on-value-column_disabled.iq | 10 ++-- ...eftQueryIsJoin@filter-rewrites-disabled.iq | 10 ++-- ...oQueriesLeftQueryIsJoin@filter-rewrites.iq | 10 ++-- ...woQueriesLeftQueryIsJoin@join-to-filter.iq | 10 ++-- ...TwoQueriesRightQueryIsJoin@all_disabled.iq | 10 ++-- ...lTwoQueriesRightQueryIsJoin@all_enabled.iq | 10 ++-- ...onAllTwoQueriesRightQueryIsJoin@default.iq | 10 ++-- ...yIsJoin@filter-on-value-column_disabled.iq | 10 ++-- ...ghtQueryIsJoin@filter-rewrites-disabled.iq | 10 ++-- ...QueriesRightQueryIsJoin@filter-rewrites.iq | 10 ++-- ...oQueriesRightQueryIsJoin@join-to-filter.iq | 10 ++-- ...ilter@all_disabled@NullHandling=default.iq | 14 +++-- ...AndFilter@all_disabled@NullHandling=sql.iq | 14 +++-- ...Filter@all_enabled@NullHandling=default.iq | 14 +++-- ...fAndFilter@all_enabled@NullHandling=sql.iq | 14 +++-- ...fAndFilter@default@NullHandling=default.iq | 14 +++-- ...artOfAndFilter@default@NullHandling=sql.iq | 14 +++-- ...ue-column_disabled@NullHandling=default.iq | 14 +++-- ...-value-column_disabled@NullHandling=sql.iq | 14 +++-- ...-rewrites-disabled@NullHandling=default.iq | 14 +++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 +++-- ...er@filter-rewrites@NullHandling=default.iq | 14 +++-- ...Filter@filter-rewrites@NullHandling=sql.iq | 14 +++-- ...ter@join-to-filter@NullHandling=default.iq | 14 +++-- ...dFilter@join-to-filter@NullHandling=sql.iq | 14 +++-- ...onFns@all_disabled@NullHandling=default.iq | 14 +++-- ...actionFns@all_disabled@NullHandling=sql.iq | 14 +++-- ...ionFns@all_enabled@NullHandling=default.iq | 14 +++-- ...ractionFns@all_enabled@NullHandling=sql.iq | 14 +++-- ...ractionFns@default@NullHandling=default.iq | 14 +++-- ...hExtractionFns@default@NullHandling=sql.iq | 14 +++-- ...ue-column_disabled@NullHandling=default.iq | 14 +++-- ...-value-column_disabled@NullHandling=sql.iq | 14 +++-- ...-rewrites-disabled@NullHandling=default.iq | 14 +++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 +++-- ...ns@filter-rewrites@NullHandling=default.iq | 14 +++-- ...ionFns@filter-rewrites@NullHandling=sql.iq | 14 +++-- ...Fns@join-to-filter@NullHandling=default.iq | 14 +++-- ...tionFns@join-to-filter@NullHandling=sql.iq | 14 +++-- ...ndOtherAggregators@NullHandling=default.iq | 10 ++-- ...ingAndOtherAggregators@NullHandling=sql.iq | 10 ++-- ...PushdownExtraction@NullHandling=default.iq | 14 +++-- ...imitPushdownExtraction@NullHandling=sql.iq | 14 +++-- .../testGroupBySortPushDown.iq | 10 ++-- ...estGroupByWithLiteralInSubqueryGrouping.iq | 10 ++-- ...gregatorsUsingJoin@NullHandling=default.iq | 30 ++++++---- ...erAggregatorsUsingJoin@NullHandling=sql.iq | 30 ++++++---- ...meFilterOnSubquery@NullHandling=default.iq | 16 +++--- ...stTimeFilterOnSubquery@NullHandling=sql.iq | 16 +++--- .../testUnionAllQueries.iq | 10 ++-- .../testUnionAllQueriesWithLimit.iq | 10 ++-- ...ingWithScanAndSort@NullHandling=default.iq | 10 ++-- ...ndowingWithScanAndSort@NullHandling=sql.iq | 10 ++-- 221 files changed, 1919 insertions(+), 1373 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java index 95d3d5228938..a98fe4124113 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java @@ -1658,4 +1658,16 @@ public File getResourceAsTemporaryFile(final String resource) } return file; } + + /** + * Adds shadowing in non-decoupled mode planning. + * + * Due to some circumstances - DruidUnnestRel have exposed all columns during planning; + * which made the VC registry to see some columns which are not selected ; and as a result + * it renamed some columns with underscores. + */ + public String ds(String colName) + { + return "_" + colName; + } } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 4b5bc28d26ad..177d1604cfcb 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -5410,7 +5410,6 @@ public void testUnnestWithInFiltersWithExpressionInInnerQuery() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNUSED_VIRTUALCOLUMN, separateDefaultModeTest = true) @Test public void testUnnestWithFiltersInnerLimit() { @@ -6853,13 +6852,13 @@ public void testUnnestWithTimeFilterOnlyNested() expressionVirtualColumn("j0.unnest", "array(\"m1\",\"m2\")", ColumnType.FLOAT_ARRAY), null ), - nestedExpressionVirtualColumn("_j0.unnest", "\"dim3\"", ColumnType.STRING), + nestedExpressionVirtualColumn(ds("j0.unnest"), "\"dim3\"", ColumnType.STRING), null )) .intervals(querySegmentSpec(Intervals.of("2000-01-02T00:00:00.000Z/2000-01-03T00:10:00.001Z"))) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_UNNEST) - .columns("_j0.unnest") + .columns(ds("j0.unnest")) .columnTypes(ColumnType.STRING) .build() ), @@ -6894,7 +6893,7 @@ public void testQuery1( public void testUnnestWithTimeFilterOnlyNestedIsBad0() { testQuery1( - "select d,c,ARRAY[m1,m2] from foo CROSS JOIN UNNEST(ARRAY[m1,m2]) as un(d) CROSS JOIN unnest(MV_TO_ARRAY(dim3)) as u(c)" + "select d,c from foo CROSS JOIN UNNEST(ARRAY[m1,m2]) as un(d) CROSS JOIN unnest(MV_TO_ARRAY(dim3)) as u(c)" + " where __time >= TIMESTAMP '2000-01-02 00:00:00' and __time <= TIMESTAMP '2000-01-03 00:10:00'", QUERY_CONTEXT_UNNEST, ImmutableList.of( diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 492625020a6c..c9eadb35c9bd 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -7811,7 +7811,6 @@ public void testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJo ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.EQUIV_PLAN_EXTRA_COLUMNS, separateDefaultModeTest = true) @Test public void testTimeFilterOnSubquery() { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq index b0328f4db531..034f274b4fb4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=default.iq @@ -20,15 +20,15 @@ SELECT substring(d3,1) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (3 rows) !ok -LogicalProject(EXPR$0=[SUBSTRING($18, 1)]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>(SUBSTRING($0, 1), 'b')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) +LogicalProject(EXPR$0=[SUBSTRING($1, 1)]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>(SUBSTRING($0, 1), 'b')]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(EXPR$0=[SUBSTRING($18, 1)], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>(SUBSTRING($0, 1), 'b')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) +DruidProject(EXPR$0=[SUBSTRING($1, 1)], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>(SUBSTRING($0, 1), 'b')]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq index b0b5281a5cc9..902a04237d77 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq @@ -20,15 +20,15 @@ SELECT substring(d3,1) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (3 rows) !ok -LogicalProject(EXPR$0=[SUBSTRING($18, 1)]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>(SUBSTRING($0, 1), 'b')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) +LogicalProject(EXPR$0=[SUBSTRING($1, 1)]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>(SUBSTRING($0, 1), 'b')]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(EXPR$0=[SUBSTRING($18, 1)], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>(SUBSTRING($0, 1), 'b')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) +DruidProject(EXPR$0=[SUBSTRING($1, 1)], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>(SUBSTRING($0, 1), 'b')]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq index cedfdd6fc78c..7c1b6965277e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq @@ -19,20 +19,22 @@ SELECT d3 FROM (select dim2,dim3 from druid.numfoo where dim2='a' LIMIT 2), UNNE (2 rows) !ok -LogicalProject(d3=[$3]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], __time=[$0]) +LogicalProject(d3=[$1]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + LogicalProject(dim3=[$1]) LogicalSort(fetch=[2]) - LogicalFilter(condition=[=($2, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalFilter(condition=[=($0, 'a')]) + LogicalProject(dim2=[$2], dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(d3=[$3], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], __time=[$0], druid=[logical]) +DruidProject(d3=[$1], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + DruidProject(dim3=[$1], druid=[logical]) DruidSort(fetch=[2], druid=[logical]) - DruidFilter(condition=[=($2, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidFilter(condition=[=($0, 'a')]) + DruidProject(dim2=[$2], dim3=[$3], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { @@ -51,12 +53,6 @@ DruidProject(d3=[$3], druid=[logical]) "type" : "intervals", "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'a'", - "outputType" : "STRING" - } ], "resultFormat" : "compactedList", "limit" : 2, "filter" : { @@ -64,8 +60,8 @@ DruidProject(d3=[$3], druid=[logical]) "dimension" : "dim2", "value" : "a" }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "STRING", "STRING", "LONG" ], + "columns" : [ "dim3" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq index 8c9c334e27f7..93462251588a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq @@ -20,20 +20,22 @@ SELECT d3 FROM (select dim2,dim3 from druid.numfoo where dim2='a' LIMIT 2), UNNE (3 rows) !ok -LogicalProject(d3=[$3]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], __time=[$0]) +LogicalProject(d3=[$1]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + LogicalProject(dim3=[$1]) LogicalSort(fetch=[2]) - LogicalFilter(condition=[=($2, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalFilter(condition=[=($0, 'a')]) + LogicalProject(dim2=[$2], dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(d3=[$3], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], __time=[$0], druid=[logical]) +DruidProject(d3=[$1], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + DruidProject(dim3=[$1], druid=[logical]) DruidSort(fetch=[2], druid=[logical]) - DruidFilter(condition=[=($2, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidFilter(condition=[=($0, 'a')]) + DruidProject(dim2=[$2], dim3=[$3], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { @@ -52,12 +54,6 @@ DruidProject(d3=[$3], druid=[logical]) "type" : "intervals", "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'a'", - "outputType" : "STRING" - } ], "resultFormat" : "compactedList", "limit" : 2, "filter" : { @@ -66,8 +62,8 @@ DruidProject(d3=[$3], druid=[logical]) "matchValueType" : "STRING", "matchValue" : "a" }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "STRING", "STRING", "LONG" ], + "columns" : [ "dim3" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq index 616ce8399831..8502ea2dc869 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=default.iq @@ -22,15 +22,15 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where st (5 rows) !ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) +LogicalProject(d3=[$1]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) +DruidProject(d3=[$1], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq index 0a2bec94e338..40527edea4c4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq @@ -23,15 +23,15 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where st (6 rows) !ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) +LogicalProject(d3=[$1]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) +DruidProject(d3=[$1], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq index 0b63ec6fcb99..adb7d762e740 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=default.iq @@ -21,15 +21,15 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3 (4 rows) !ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'd')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) +LogicalProject(d3=[$1]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>($0, 'd')]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'd')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) +DruidProject(d3=[$1], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>($0, 'd')]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq index 7b7bf5eecff0..c2337e90168a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq @@ -22,15 +22,15 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3 (5 rows) !ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'd')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) +LogicalProject(d3=[$1]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>($0, 'd')]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'd')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) +DruidProject(d3=[$1], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>($0, 'd')]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq index d2f2548b675a..722ef1de9af2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq @@ -25,9 +25,10 @@ LogicalSort(fetch=[1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim4=[$4], m1=[$14]) LogicalTableScan(table=[[druid, numfoo]]) - LogicalAggregate(group=[{4}]) - LogicalFilter(condition=[<>($4, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, 'a')]) + LogicalProject(dim4=[$4]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidSort(fetch=[1], druid=[logical]) @@ -35,9 +36,10 @@ DruidSort(fetch=[1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim4=[$4], m1=[$14], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidAggregate(group=[{4}], druid=[logical]) - DruidFilter(condition=[<>($4, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, 'a')]) + DruidProject(dim4=[$4], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq index 89919ef819ae..4801431c81fc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq @@ -25,9 +25,10 @@ LogicalSort(fetch=[1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim4=[$4], m1=[$14]) LogicalTableScan(table=[[druid, numfoo]]) - LogicalAggregate(group=[{4}]) - LogicalFilter(condition=[<>($4, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, 'a')]) + LogicalProject(dim4=[$4]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidSort(fetch=[1], druid=[logical]) @@ -35,9 +36,10 @@ DruidSort(fetch=[1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim4=[$4], m1=[$14], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidAggregate(group=[{4}], druid=[logical]) - DruidFilter(condition=[<>($4, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, 'a')]) + DruidProject(dim4=[$4], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq index 699b9c230520..a22c4c162800 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq index 52087ed62765..8a0ce77fc8f4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq index 559eadb36320..5073aec32075 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq index 33556cd485fa..0e3e294f1adf 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq index b6c55a471df1..f9f2462bde26 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq @@ -28,9 +28,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq index 09785d5c178c..84739e3d0ee5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq @@ -28,9 +28,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq index fd3f5b44f810..48deebbf17fc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq index 8ce84d69e397..7e207f136230 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq index 05bc33e20708..d37099308d86 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq index 82d7dcdee5c0..3190ce1fe96c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq index f554299bc8be..2f559632abca 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq index eb38a3c33f01..013f77c38d8d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq index ede90bee602d..2b56c56248cb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq index 5ae0e78c10c8..3588a764d2c2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq @@ -31,9 +31,10 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -43,9 +44,10 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq index 6a7c709365b9..0f662bd1aed3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq index e553be29d9f1..5b0c94c3c163 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq index 4829e9398151..b2bcb7177692 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq index fa054c162254..3575927cff4d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq index 587178dde591..09ce7787fb80 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq @@ -27,9 +27,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -37,9 +38,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq index 9f04823844c1..7a037d8bb8c1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq @@ -27,9 +27,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -37,9 +38,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq index d33427702e8b..e213a2a5c350 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq index 8ab934aa38b5..424482d85e1f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq index 3a5f56259901..fbbaf340ee99 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq index 68861b993c76..f9b22aa51eb8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq index 5cfae3e4b94a..09b51f79ef38 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq index 3b35adf2a126..75540d74b713 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq index 758f4c48bf4d..ff312797eec8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq index 154056ddf061..02f5bafb7881 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq index 24f52e8a1c0d..bd58defdb6d6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq index bd2b636c01d4..4de014680045 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq index 8151cc91a3ae..db9e70b45fa3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq index 246e608caa57..4b15b4865294 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq index 87d1ef730e79..d598bc106612 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq @@ -27,9 +27,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -37,9 +38,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq index c8506ace31dc..25d93d5f2e42 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq @@ -27,9 +27,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -37,9 +38,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq index 2c622d5977fc..db9e3b83a213 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq index fced12990b83..72b983da6138 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq index d5d73892fc1a..59f846f6a407 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq index 610260e4e65d..05a2df80a875 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq index 3efe170e8085..eafaff6806a3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq index 9ebbc7e18d35..38555c87dedf 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq index 1bd6a87b9a07..06fa411810a6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq index 50484dab8b94..d3e089ddcaf4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq index c08b970f1617..ae408515be44 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5]) - LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2]) + LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)], druid=[logical]) @@ -41,9 +42,10 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical]) - DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2], druid=[logical]) + DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq index 07124f8cac04..c75b0f7b627a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5]) - LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2]) + LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)], druid=[logical]) @@ -41,9 +42,10 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical]) - DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2], druid=[logical]) + DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq index 2f78608ebffd..82d9238cac8c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5]) - LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2]) + LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) @@ -41,9 +42,10 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical]) - DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2], druid=[logical]) + DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq index 2a03f6e25160..9774f3a55958 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5]) - LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2]) + LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) @@ -41,9 +42,10 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical]) - DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2], druid=[logical]) + DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq index f2275d4db00f..998c9712b196 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5]) - LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$2]) + LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) @@ -41,9 +42,10 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5], druid=[logical]) - DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$2], druid=[logical]) + DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq index 077841f3fe90..129f7ab4e406 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5]) - LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$2]) + LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) @@ -41,9 +42,10 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5], druid=[logical]) - DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$2], druid=[logical]) + DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq index b29ee72ab4f1..127cf341725d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq @@ -18,21 +18,21 @@ SELECT COUNT(*) FILTER (WHERE FLOOR(100) NOT IN (SELECT m1 FROM foo)) FROM foo; !ok LogicalAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0]) - LogicalProject($f0=[IS NULL($2)]) - LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $1)], joinType=[left]) - LogicalProject(DUMMY=[0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{5}], i=[LITERAL_AGG(true)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject($f0=[IS NULL($9)]) + LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $8)], joinType=[left]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}], i=[LITERAL_AGG(true)]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) - DruidProject($f0=[IS NULL($2)], druid=[logical]) - DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $1)], joinType=[left]) - DruidProject(DUMMY=[0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{5}], i=[LITERAL_AGG(true)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject($f0=[IS NULL($9)], druid=[logical]) + DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $8)], joinType=[left]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], i=[LITERAL_AGG(true)], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -40,31 +40,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) "dataSource" : { "type" : "join", "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "0", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "v0" ], - "columnTypes" : [ "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "table", + "name" : "foo" }, "right" : { "type" : "query", diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq index 1f2ac13cefef..0e602d6d0867 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq @@ -18,27 +18,29 @@ SELECT COUNT(*) FILTER (WHERE FLOOR(100) NOT IN (SELECT m1 FROM foo)) FROM foo; !ok LogicalAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0]) - LogicalProject($f0=[OR(=($1, 0), AND(IS NULL($4), >=($2, $1)))]) - LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $3)], joinType=[left]) + LogicalProject($f0=[OR(=($8, 0), AND(IS NULL($11), >=($9, $8)))]) + LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $10)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) - LogicalProject(DUMMY=[0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($5)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{5}], i=[LITERAL_AGG(true)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}], i=[LITERAL_AGG(true)]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) - DruidProject($f0=[OR(=($1, 0), AND(IS NULL($4), >=($2, $1)))], druid=[logical]) - DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $3)], joinType=[left]) + DruidProject($f0=[OR(=($8, 0), AND(IS NULL($11), >=($9, $8)))], druid=[logical]) + DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $10)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) - DruidProject(DUMMY=[0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($5)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{5}], i=[LITERAL_AGG(true)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], i=[LITERAL_AGG(true)], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -48,31 +50,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) "left" : { "type" : "join", "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "0", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "v0" ], - "columnTypes" : [ "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "table", + "name" : "foo" }, "right" : { "type" : "query", diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq index 2f4290fed6de..37698f164443 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq index 93293e3f7e80..16f93880854b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq index 27d860eb9f04..bbd8cacac851 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq index 90f37d025af6..272949a3ebf6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq index 845d81b6a3fc..4284c0b3f3c6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq @@ -27,9 +27,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -37,9 +38,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq index ab43f9604a69..e5e92ef81856 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq @@ -27,9 +27,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -37,9 +38,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq index 8f7728670181..d35be8886830 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq index 0d4e75093b95..5cf96c85a7f7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq index eaf39cc2e5a8..84fa5a7112f2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq index 602e70825959..41682ec2cde9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq index fe73169674d1..02215c6bf087 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq index e719d27e6dff..46d755904b30 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq index 0e75a816828a..ffc5803e0aed 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq index c74c2744c540..bb823ec44288 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq index 9856d6880d74..67538eabd4ec 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq index 5682326c03e0..1f79d1249793 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq index dd18a691b267..76818f89b159 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq index 098f6a50bc90..9be48cb39953 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq index dd0fe8341b5d..a9e04727d846 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq @@ -27,20 +27,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq index a27da638639d..3686ceb105e4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq @@ -27,20 +27,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq index 22719f86aea2..3f971a6a09ed 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq index 295802c72308..93a5853c01ad 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq index de427c4ece07..569446f1bf4a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq index 8815732fe58c..fed4c5113ac0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq index 7973786f10ec..e9034a647525 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq index d5e5d614e3dc..70e0fa0dac7e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq index c1b280b3803c..0ca14134123e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq index 0a1b6a66606f..e45f471d7aa1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq @@ -30,20 +30,24 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq index 9149b1cebb62..6a20a8919ffa 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq index 7dbc2ff6923d..dcf896c46a68 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq index ba5ed17c9e7e..3e87fc451660 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq index e4c05ae03b3c..e847a4a09231 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq index fd632f528467..07ef05d87c8b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq @@ -27,9 +27,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -37,9 +38,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq index 40515f8b62d5..66a5d41ee3fb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq @@ -27,9 +27,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -37,9 +38,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq index eb287c5eeedd..083244330bba 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq index 54427093b152..1172e3f1cdf8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq index e36e08bdf07d..dd8150e964fb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq index 9227fb31b5e3..20b7e1ee40a6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq index 6d586cb7eebd..3a6b73d1f321 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq index 580ed6694725..bc57a0b72f67 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq index e108a87115d4..dd79b380268e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq index 800a422b8f09..5d1169c0beed 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq @@ -30,9 +30,10 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($0, '10.1')]) + LogicalProject(dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -40,9 +41,10 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($0, '10.1')]) + DruidProject(dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq index 20ec2ea73667..d3b2624ac8db 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -104,8 +108,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq index f10f8b5da377..3d362992c61e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -103,8 +107,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq index 0b39259a86c4..58349526e65a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -104,8 +108,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq index a908f72f7db9..3395ad549f16 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -103,8 +107,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq index d9d6187ebef8..50f43d1331c0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq @@ -24,10 +24,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -37,10 +39,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -101,8 +105,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq index 90488aa3e3bf..9e11899f6757 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq @@ -24,10 +24,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -37,10 +39,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -100,8 +104,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq index a5fb9afeabcb..58117eb96461 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -104,8 +108,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq index d904ef913db7..8e2e37efb6c3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -103,8 +107,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq index 121c2724a62a..d5dcf636a064 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -104,8 +108,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq index 4090856cccaa..9680b09c320f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -103,8 +107,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq index dede5bf4ed0a..7a6c7da8e261 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -104,8 +108,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq index d9b008e0915f..5ca54c6c0479 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -103,8 +107,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq index 220d7f4545f2..021299b669d9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -104,8 +108,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq index 8297fc814d97..ddc0df483b2b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq @@ -27,10 +27,12 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalFilter(condition=[=($0, 'def')]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1], m2=[$6]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) @@ -40,10 +42,12 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidFilter(condition=[=($0, 'def')]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], m2=[$6], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -103,8 +107,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] }, "resultFormat" : "compactedList", - "columns" : [ "dim1", "m2" ], - "columnTypes" : [ "STRING", "DOUBLE" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq index 101a7b6c74d7..45ebc7ad6302 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq index 6d0ffd3c3c96..08ae89827a16 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq index f46ed02d1371..4e6351576244 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq index b733c4c086b9..c701b95003f3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq index f24615642dfa..ce8035ca10d4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq @@ -31,9 +31,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -44,9 +46,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq index f3ecb3bea56a..d82aeb2ff825 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq @@ -31,9 +31,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -44,9 +46,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq index 5b19c4c25634..e38ba8480aa8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq index 7701a02bfee1..f880ad5b4a28 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq index 37b054a823b8..e6b11a3e1a6f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq index 9760704dac36..9fe9ec5deafc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq index 56a68a1d1629..9afd0d09c7fc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq index 5fbc891a4757..623094f55027 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq index 889203c5566d..9b1014830020 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq index 937d559604c6..1f63827dc90e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq @@ -34,9 +34,11 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -47,9 +49,11 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq index 3b4612fe1fa3..0b18ee748790 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq index dabbf8c9566f..a9e022e7604b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq index 3b1114343cdf..41352425a130 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq index 69fbdc2839ed..0ec49584d16e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq index 72af14b10af5..95185830cb41 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq @@ -31,13 +31,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -49,13 +52,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq index 9e08a5e66bb9..ae4653b2be6b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq @@ -31,13 +31,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -49,13 +52,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq index 55a081a200bf..70ece273d012 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq index c3153057a2db..14989b9a9599 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq index 1669befcb8b3..a0796fc92672 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq index 25c11967aa4b..aa827513393f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq index c1d251bc1e9e..be69252c978f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq index 07f8519ba404..8749922e20c0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq index 79ee3f8a6db4..dbcb2cefd1ce 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq index 2b1c95734afd..f250ad3bab80 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq @@ -34,13 +34,16 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(__time=[$0]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -52,13 +55,16 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(__time=[$0], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq index 396d37ca2e21..815cee22081c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq @@ -31,9 +31,10 @@ LogicalProject(EXPR$0=[$1], EXPR$1=[$0]) LogicalFilter(condition=[<>($1, '')]) LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[=($0, 'def')]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(EXPR$0=[$1], EXPR$1=[$0], druid=[logical]) @@ -43,9 +44,10 @@ DruidProject(EXPR$0=[$1], EXPR$1=[$0], druid=[logical]) DruidFilter(condition=[<>($1, '')]) DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[=($0, 'def')]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq index 2ac2cbd28309..5cdc962836da 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq @@ -31,9 +31,10 @@ LogicalProject(EXPR$0=[$1], EXPR$1=[$0]) LogicalFilter(condition=[<>($1, '')]) LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[=($0, 'def')]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(EXPR$0=[$1], EXPR$1=[$0], druid=[logical]) @@ -43,9 +44,10 @@ DruidProject(EXPR$0=[$1], EXPR$1=[$0], druid=[logical]) DruidFilter(condition=[<>($1, '')]) DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[=($0, 'def')]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq index 675d6a757be9..3509ec6a1a4c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq @@ -27,9 +27,10 @@ LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) LogicalFilter(condition=[<>($1, '')]) LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[=($0, 'def')]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) @@ -37,9 +38,10 @@ DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) DruidFilter(condition=[<>($1, '')]) DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[=($0, 'def')]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq index a76916e1296e..4511c06a1e33 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq @@ -27,9 +27,10 @@ LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) LogicalFilter(condition=[<>($1, '')]) LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[=($0, 'def')]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) @@ -37,9 +38,10 @@ DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) DruidFilter(condition=[<>($1, '')]) DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[=($0, 'def')]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq index 31676bf61071..2a1fe567c7bc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq index 6912ce744091..9d80ada42429 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq index e7a7c8a63d46..50e4c3675ec1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq index 6ebb59c96d2e..5b288ec474d9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq index 9251aac16028..c8ffd0383265 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq @@ -28,11 +28,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -42,11 +44,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq index bb2d3b4a5914..c8601dc53bb4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq @@ -28,11 +28,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -42,11 +44,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq index f92d14a0a082..4d7eb46237cc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq index 081e03cf0481..e1021e77dbbd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq index 1ac6b640dd69..427ddddec469 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq index b8a128c8c83c..763904087ce8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq index 48e3f064fb58..177e9f80e215 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq index aeb265a2e2fe..22a0d6f42ce2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq index acbdbb3e40fe..0793a84dd071 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq index c457e64c1239..a19e12604da6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq @@ -31,11 +31,13 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalProject(__time=[$0], dim1=[$1]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[=($1, 1)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalFilter(condition=[<>($1, 2)]) + LogicalProject(__time=[$0], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -45,11 +47,13 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(__time=[$0], dim1=[$1], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[=($1, 1)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidFilter(condition=[<>($1, 2)]) + DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_disabled.iq index 890e2d861616..a48263f5c6a8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_disabled.iq @@ -28,8 +28,9 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -39,8 +40,9 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_enabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_enabled.iq index f8fef5db5176..23602dc99f08 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_enabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_enabled.iq @@ -28,8 +28,9 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -39,8 +40,9 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@default.iq index c215c664567c..7e20f3dbd39f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@default.iq @@ -25,8 +25,9 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -36,8 +37,9 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-on-value-column_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-on-value-column_disabled.iq index 1e5ff447f876..e07745a1a5ce 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-on-value-column_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-on-value-column_disabled.iq @@ -28,8 +28,9 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -39,8 +40,9 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites-disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites-disabled.iq index f5ee8b38c819..401229c64f02 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites-disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites-disabled.iq @@ -28,8 +28,9 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -39,8 +40,9 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites.iq index 66213a432d60..bf6bb07a9713 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites.iq @@ -28,8 +28,9 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -39,8 +40,9 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@join-to-filter.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@join-to-filter.iq index 01202d21211b..daffe515483c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@join-to-filter.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@join-to-filter.iq @@ -28,8 +28,9 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -39,8 +40,9 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_disabled.iq index 8000f8cc6df8..75d958152e3f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_disabled.iq @@ -22,8 +22,9 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -33,8 +34,9 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_enabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_enabled.iq index 0093d4e581da..1cf4e11db901 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_enabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_enabled.iq @@ -22,8 +22,9 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -33,8 +34,9 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@default.iq index 791603a22fe2..ae6924289a80 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@default.iq @@ -19,8 +19,9 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -30,8 +31,9 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-on-value-column_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-on-value-column_disabled.iq index d17665f24acb..71a67ca62a98 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-on-value-column_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-on-value-column_disabled.iq @@ -22,8 +22,9 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -33,8 +34,9 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites-disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites-disabled.iq index 1199eca6b1ee..5152ceb6471f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites-disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites-disabled.iq @@ -22,8 +22,9 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -33,8 +34,9 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites.iq index 80bba8f87d08..d08cdd3ea622 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites.iq @@ -22,8 +22,9 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -33,8 +34,9 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@join-to-filter.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@join-to-filter.iq index 02a589ab2026..69d77a12634f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@join-to-filter.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@join-to-filter.iq @@ -22,8 +22,9 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -33,8 +34,9 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq index 8398bd47433a..ac60be0f1877 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq index 5bc8df831e2e..b1ea09cd1ba7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq index d00e48a310e9..1f9dc026e281 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq index 392a11cecfb4..f7b42e15f3d3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq index 2821adc1c6e0..2862670cadba 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq @@ -26,9 +26,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -37,9 +38,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq index 7b0882069eb8..559423dd4c11 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq @@ -26,9 +26,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -37,9 +38,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq index 1987ab4c04b5..82a4547547a9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq index f6e3943305db..be682a074983 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq index 706bec28edf9..d6af4f932825 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq index 208b080e226d..60044dedc39b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq index f5c84712ef52..cb834c89adfb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq index 759d73986dd0..fa0c14f0353f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq index 7fca495c2b47..3a0ccd84b1b5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq index cb4dd3a2e998..1fca19d87b55 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq @@ -29,9 +29,10 @@ LogicalSort(sort0=[$1], dir0=[ASC]) LogicalFilter(condition=[<>($0, 'xxx')]) LogicalProject(dim1=[$1], dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) @@ -40,9 +41,10 @@ DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidFilter(condition=[<>($0, 'xxx')]) DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq index dcff8e213aee..65b0c6d0b4a5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq index cb04db285061..169bcb8c20df 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq index e45394da7f8f..4cb67b4369a3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq index 105c345ee9c0..5b2166114f2e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq index ad6509bd826e..a1d9690fb3f5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq @@ -23,9 +23,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -33,9 +34,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq index 6dffa2cc78df..3d29257742f2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq @@ -23,9 +23,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -33,9 +34,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq index 346a65b95040..4f19e43af855 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq index 1bd6bffa1f2d..0a4e3f444e14 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq index 9b72fc597c0a..ed51ff790238 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq index b27b5b8cb573..e372c1efac7e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq index c2c40dc99523..3b71cf83b0c6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq index c03d202cdaee..82838f4462ad 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq index b08872faf7d7..99221dc5ea3d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq index 40229ea1ec11..5b8f4e646c51 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq @@ -26,9 +26,10 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) + LogicalFilter(condition=[<>($0, '')]) + LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -36,9 +37,10 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($0, '')]) + DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq index 70979223a8e8..e4645bff7d32 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq @@ -21,13 +21,15 @@ SELECT dim2, SUM(cnt), COUNT(distinct dim1) FROM druid.foo GROUP BY dim2; !ok LogicalAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{1, 2}], EXPR$1=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0, 1}], EXPR$1=[SUM($2)]) + LogicalProject(dim1=[$1], dim2=[$2], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{1, 2}], EXPR$1=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0, 1}], EXPR$1=[SUM($2)], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq index 636b96669464..3e8da105d297 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq @@ -22,13 +22,15 @@ SELECT dim2, SUM(cnt), COUNT(distinct dim1) FROM druid.foo GROUP BY dim2; !ok LogicalAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{1, 2}], EXPR$1=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0, 1}], EXPR$1=[SUM($2)]) + LogicalProject(dim1=[$1], dim2=[$2], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{1, 2}], EXPR$1=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0, 1}], EXPR$1=[SUM($2)], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq index ee8ff3e4ed42..71b6867f5ced 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq @@ -21,17 +21,19 @@ SELECT dim4, substring(dim5, 1, 1), count(*) FROM druid.numfoo WHERE dim4 = 'a' LogicalProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1]) LogicalSort(fetch=[2]) LogicalAggregate(group=[{0}], EXPR$2=[COUNT()]) - LogicalProject(EXPR$1=[SUBSTRING($5, 1, 1)]) - LogicalFilter(condition=[=($4, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalProject(EXPR$1=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[=($0, 'a')]) + LogicalProject(dim4=[$4], dim5=[$5]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1], druid=[logical]) DruidSort(fetch=[2], druid=[logical]) DruidAggregate(group=[{0}], EXPR$2=[COUNT()], druid=[logical]) - DruidProject(EXPR$1=[SUBSTRING($5, 1, 1)], druid=[logical]) - DruidFilter(condition=[=($4, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidProject(EXPR$1=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[=($0, 'a')]) + DruidProject(dim4=[$4], dim5=[$5], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq index 1f49a1cb53ee..04eab8832866 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq @@ -21,17 +21,19 @@ SELECT dim4, substring(dim5, 1, 1), count(*) FROM druid.numfoo WHERE dim4 = 'a' LogicalProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1]) LogicalSort(fetch=[2]) LogicalAggregate(group=[{0}], EXPR$2=[COUNT()]) - LogicalProject(EXPR$1=[SUBSTRING($5, 1, 1)]) - LogicalFilter(condition=[=($4, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalProject(EXPR$1=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[=($0, 'a')]) + LogicalProject(dim4=[$4], dim5=[$5]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1], druid=[logical]) DruidSort(fetch=[2], druid=[logical]) DruidAggregate(group=[{0}], EXPR$2=[COUNT()], druid=[logical]) - DruidProject(EXPR$1=[SUBSTRING($5, 1, 1)], druid=[logical]) - DruidFilter(condition=[=($4, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidProject(EXPR$1=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[=($0, 'a')]) + DruidProject(dim4=[$4], dim5=[$5], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupBySortPushDown.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupBySortPushDown.iq index ce70e1c2ba2e..5cfca6d21905 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupBySortPushDown.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupBySortPushDown.iq @@ -22,14 +22,16 @@ SELECT dim2, dim1, SUM(cnt) FROM druid.foo GROUP BY dim2, dim1 ORDER BY dim1 LIM !ok LogicalProject(dim2=[$1], dim1=[$0], EXPR$2=[$2]) LogicalSort(sort0=[$0], dir0=[ASC], fetch=[4]) - LogicalAggregate(group=[{1, 2}], EXPR$2=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0, 1}], EXPR$2=[SUM($2)]) + LogicalProject(dim1=[$1], dim2=[$2], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim2=[$1], dim1=[$0], EXPR$2=[$2], druid=[logical]) DruidSort(sort0=[$0], dir0=[ASC], fetch=[4], druid=[logical]) - DruidAggregate(group=[{1, 2}], EXPR$2=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0, 1}], EXPR$2=[SUM($2)], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq index da905b0336c1..8e4cb7c4b7a4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq @@ -39,15 +39,17 @@ SELECT LogicalProject(t1=['dummy'], t2=[$0]) LogicalAggregate(group=[{0}]) LogicalProject(t2=[CASE(=($0, 'b'), $0, null:VARCHAR)]) - LogicalAggregate(group=[{4}]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalAggregate(group=[{0}]) + LogicalProject(dim4=[$4]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(t1=['dummy'], t2=[$0], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(t2=[CASE(=($0, 'b'), $0, null:VARCHAR)], druid=[logical]) - DruidAggregate(group=[{4}], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidAggregate(group=[{0}], druid=[logical]) + DruidProject(dim4=[$4], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq index 2fe7189d611e..6231ea35d4a6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq @@ -23,27 +23,33 @@ SELECT dim2, COUNT(*), COUNT(distinct dim1), COUNT(distinct cnt) FROM druid.foo LogicalProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) + LogicalProject(dim2=[$2]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{1}], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{1, 2}]) + LogicalAggregate(group=[{0, 1}]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}], EXPR$3=[COUNT()]) + LogicalAggregate(group=[{0, 1}]) + LogicalProject(dim2=[$2], cnt=[$4]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], EXPR$3=[COUNT($1)]) - LogicalAggregate(group=[{2, 4}]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5], druid=[logical]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) + DruidProject(dim2=[$2], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{1}], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{1, 2}], druid=[logical]) + DruidAggregate(group=[{0, 1}], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], EXPR$3=[COUNT()], druid=[logical]) + DruidAggregate(group=[{0, 1}], druid=[logical]) + DruidProject(dim2=[$2], cnt=[$4], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], EXPR$3=[COUNT($1)], druid=[logical]) - DruidAggregate(group=[{2, 4}], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq index 315013109433..c9e2aee4f6a0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq @@ -24,27 +24,33 @@ SELECT dim2, COUNT(*), COUNT(distinct dim1), COUNT(distinct cnt) FROM druid.foo LogicalProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{1, 2}]) + LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) + LogicalProject(dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}], EXPR$2=[COUNT($0)]) + LogicalAggregate(group=[{0, 1}]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], EXPR$3=[COUNT($1)]) - LogicalAggregate(group=[{2, 4}]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0, 1}]) + LogicalProject(dim2=[$2], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5], druid=[logical]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{1, 2}], druid=[logical]) + DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) + DruidProject(dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], EXPR$2=[COUNT($0)], druid=[logical]) + DruidAggregate(group=[{0, 1}], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], EXPR$3=[COUNT($1)], druid=[logical]) - DruidAggregate(group=[{2, 4}], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0, 1}], druid=[logical]) + DruidProject(dim2=[$2], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq index c864ecb8df14..6a74658a830b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq @@ -19,15 +19,15 @@ WHERE TIME_IN_INTERVAL(__time, '2000/P1D') OR TIME_IN_INTERVAL(__time, '2001/P1D (2 rows) !ok -LogicalProject(__time=[$0], m1=[$5]) - LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - LogicalSort(fetch=[100]) +LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) + LogicalSort(fetch=[100]) + LogicalProject(__time=[$0], m1=[$5]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(__time=[$0], m1=[$5], druid=[logical]) - DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - DruidSort(fetch=[100], druid=[logical]) +DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) + DruidSort(fetch=[100], druid=[logical]) + DruidProject(__time=[$0], m1=[$5], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan @@ -47,8 +47,8 @@ DruidProject(__time=[$0], m1=[$5], druid=[logical]) }, "resultFormat" : "compactedList", "limit" : 100, - "columns" : [ "__time", "dim1", "dim2", "dim3", "cnt", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], + "columns" : [ "__time", "m1" ], + "columnTypes" : [ "LONG", "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq index 7906b3d4c0fd..08aa7cdd3eb8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq @@ -19,15 +19,15 @@ WHERE TIME_IN_INTERVAL(__time, '2000/P1D') OR TIME_IN_INTERVAL(__time, '2001/P1D (2 rows) !ok -LogicalProject(__time=[$0], m1=[$5]) - LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - LogicalSort(fetch=[100]) +LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) + LogicalSort(fetch=[100]) + LogicalProject(__time=[$0], m1=[$5]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(__time=[$0], m1=[$5], druid=[logical]) - DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - DruidSort(fetch=[100], druid=[logical]) +DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) + DruidSort(fetch=[100], druid=[logical]) + DruidProject(__time=[$0], m1=[$5], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan @@ -47,8 +47,8 @@ DruidProject(__time=[$0], m1=[$5], druid=[logical]) }, "resultFormat" : "compactedList", "limit" : 100, - "columns" : [ "__time", "dim1", "dim2", "dim3", "cnt", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], + "columns" : [ "__time", "m1" ], + "columnTypes" : [ "LONG", "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueries.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueries.iq index e4c98567392d..553d5b692f76 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueries.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueries.iq @@ -22,8 +22,9 @@ SELECT COUNT(*) FROM foo UNION ALL SELECT SUM(cnt) FROM foo UNION ALL SELECT COU LogicalUnion(all=[true]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalTableScan(table=[[druid, foo]]) @@ -31,8 +32,9 @@ LogicalUnion(all=[true]) DruidUnion(all=[true]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueriesWithLimit.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueriesWithLimit.iq index 49fa808fe731..e62aa27f86df 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueriesWithLimit.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueriesWithLimit.iq @@ -22,8 +22,9 @@ LogicalSort(fetch=[2]) LogicalUnion(all=[true]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) + LogicalProject(cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalTableScan(table=[[druid, foo]]) @@ -32,8 +33,9 @@ DruidSort(fetch=[2], druid=[logical]) DruidUnion(all=[true]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) + DruidProject(cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq index a893185365e6..8478efa187be 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq @@ -35,8 +35,9 @@ LogicalProject(ranking=[$2], trend_score=[$1]) LogicalSort(fetch=[10]) LogicalWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) LogicalProject(m2=[$1], trend_score=[$2]) - LogicalAggregate(group=[{5, 6}], trend_score=[COUNT()]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0, 1}], trend_score=[COUNT()]) + LogicalProject(m1=[$5], m2=[$6]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) @@ -44,8 +45,9 @@ DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) DruidSort(fetch=[10], druid=[logical]) DruidWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) DruidProject(m2=[$1], trend_score=[$2], druid=[logical]) - DruidAggregate(group=[{5, 6}], trend_score=[COUNT()], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0, 1}], trend_score=[COUNT()], druid=[logical]) + DruidProject(m1=[$5], m2=[$6], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq index 3eb700c018fd..0891527056b9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq @@ -35,8 +35,9 @@ LogicalProject(ranking=[$2], trend_score=[$1]) LogicalSort(fetch=[10]) LogicalWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) LogicalProject(m2=[$1], trend_score=[$2]) - LogicalAggregate(group=[{5, 6}], trend_score=[COUNT($5)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0, 1}], trend_score=[COUNT($0)]) + LogicalProject(m1=[$5], m2=[$6]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) @@ -44,8 +45,9 @@ DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) DruidSort(fetch=[10], druid=[logical]) DruidWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) DruidProject(m2=[$1], trend_score=[$2], druid=[logical]) - DruidAggregate(group=[{5, 6}], trend_score=[COUNT($5)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0, 1}], trend_score=[COUNT($0)], druid=[logical]) + DruidProject(m1=[$5], m2=[$6], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { From 7d9693bd916963aab50db1eb50b3f916cfc9fc52 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 18:00:52 +0000 Subject: [PATCH 28/99] aa --- .../calcite/planner/CalciteRulesManager.java | 5 + .../sql/calcite/BaseCalciteQueryTest.java | 11 +- .../sql/calcite/CalciteArraysQueryTest.java | 22 +-- ...sArrayColumnsOrFilters@NullHandling=sql.iq | 157 ++++++++++++++++++ ...ExpressionInInnerQuery@NullHandling=sql.iq | 22 +-- ...ExpressionInInnerQuery@NullHandling=sql.iq | 22 +-- 6 files changed, 208 insertions(+), 31 deletions(-) create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 65cf2d942632..bfaa9b9de046 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -37,6 +37,7 @@ import org.apache.calcite.rel.metadata.DefaultRelMetadataProvider; import org.apache.calcite.rel.rules.CoreRules; import org.apache.calcite.rel.rules.DateRangeRules; +import org.apache.calcite.rel.rules.FilterCorrelateRule; import org.apache.calcite.rel.rules.FilterJoinRule.FilterIntoJoinRule.FilterIntoJoinRuleConfig; import org.apache.calcite.rel.rules.JoinExtractFilterRule; import org.apache.calcite.rel.rules.JoinPushThroughJoinRule; @@ -280,6 +281,10 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder.addMatchLimit(CalciteRulesManager.HEP_DEFAULT_MATCH_LIMIT); builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); + builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); + builder.addRuleCollection(baseRuleSet(plannerContext)); + builder.addRuleInstance(CoreRules.UNION_MERGE); + builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); builder.addRuleInstance(new LogicalUnnestRule()); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java index a98fe4124113..0adcd4bcb670 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java @@ -1668,6 +1668,15 @@ public File getResourceAsTemporaryFile(final String resource) */ public String ds(String colName) { - return "_" + colName; + if (testBuilder().isDecoupledMode()) { + return colName; + } else { + return "_" + colName; + } + } + + public String ds2(String colName) + { + return ds(ds(colName)); } } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 177d1604cfcb..8a53716cd9d5 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4598,7 +4598,7 @@ public void testUnnestTwiceWithFiltersAndExpressions() } -// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) + @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestThriceWithFiltersOnDimAndUnnestCol() { @@ -4685,7 +4685,7 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestCol() ); } -// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) + @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumns() { @@ -4889,6 +4889,8 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations() ); } + // FIXME: thyis +// @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters() { @@ -5338,7 +5340,7 @@ public void testUnnestWithFilters() ); } -// @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) @Test public void testUnnestWithFiltersWithExpressionInInnerQuery() { @@ -5375,7 +5377,7 @@ public void testUnnestWithFiltersWithExpressionInInnerQuery() ); } -// @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) @Test public void testUnnestWithInFiltersWithExpressionInInnerQuery() { @@ -5477,7 +5479,7 @@ public void testUnnestWithFiltersInsideAndOutside() not(equality("dim1", "foo", ColumnType.STRING)) ) ), - expressionVirtualColumn("j0.unnest", "\"dim3\"", ColumnType.STRING), + nestedExpressionVirtualColumn("j0.unnest", "\"dim3\"", ColumnType.STRING), not(equality("j0.unnest", "b", ColumnType.STRING)) )) .intervals(querySegmentSpec(Filtration.eternity())) @@ -5703,8 +5705,8 @@ public void testUnnestWithGroupByOrderByOnVirtualColumn() ); } -// @NotYetSupported(Modes.UNNEST_RESULT_MISMATCH) -// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) + @NotYetSupported(Modes.UNNEST_RESULT_MISMATCH) + @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestWithJoinOnTheLeft() { @@ -6985,16 +6987,16 @@ public void testUnnestWithTimeFilterOnlyNestedAndNestedAgain() expressionVirtualColumn("j0.unnest", "array(\"m1\",\"m2\")", ColumnType.FLOAT_ARRAY), null ), - expressionVirtualColumn("_j0.unnest", "array(\"dim1\",\"dim2\")", ColumnType.STRING_ARRAY), + expressionVirtualColumn(ds("j0.unnest"), "array(\"dim1\",\"dim2\")", ColumnType.STRING_ARRAY), null ), - nestedExpressionVirtualColumn("__j0.unnest", "\"dim3\"", ColumnType.STRING), + nestedExpressionVirtualColumn(ds2("j0.unnest"), "\"dim3\"", ColumnType.STRING), null )) .intervals(querySegmentSpec(Intervals.of("2000-01-02T00:00:00.000Z/2000-01-03T00:10:00.001Z"))) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_UNNEST) - .columns("__j0.unnest") + .columns(ds2("j0.unnest")) .columnTypes(ColumnType.STRING) .build() ), diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq new file mode 100644 index 000000000000..a31d4d142c97 --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq @@ -0,0 +1,157 @@ +# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql case-crc:727a851b +# quidem testcase reason: UNNEST_EXTRA_SCAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// + SELECT arrayString, uln, udn, usn FROM + ( SELECT * FROM + ( SELECT * FROM arrays, UNNEST(arrayLongNulls) as ut(uln)) ,UNNEST(arrayDoubleNulls) as ut(udn) + ), UNNEST(arrayStringNulls) as ut(usn) WHERE arrayString = ARRAY['a','b'] AND (uln = 1 OR udn = 2.2) AND usn = 'a'; ++-------------+-----+-----+-----+ +| arrayString | uln | udn | usn | ++-------------+-----+-----+-----+ +| [a, b] | 1 | 1.1 | a | +| [a, b] | 1 | 2.2 | a | +| [a, b] | 1 | | a | +| [a, b] | 3 | 2.2 | a | +| [a, b] | | 2.2 | a | ++-------------+-----+-----+-----+ +(5 rows) + +!ok +LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$2], udn=[$3], usn=[$4]) + LogicalUnnest(unnestExpr=[$1], filter=[=($0, 'a')]) + LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], arrayStringNulls=[$1], uln=[$3], udn=[$4]) + LogicalFilter(condition=[OR(=($3, 1), =($4, 2.2))]) + LogicalUnnest(unnestExpr=[$2]) + LogicalProject(arrayString=[$0], arrayStringNulls=[$1], arrayDoubleNulls=[$3], uln=[$4]) + LogicalUnnest(unnestExpr=[$2]) + LogicalFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + LogicalProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) + LogicalTableScan(table=[[druid, arrays]]) + +!logicalPlan +DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$2], udn=[$3], usn=[$4], druid=[logical]) + DruidUnnest(unnestExpr=[$1], filter=[=($0, 'a')]) + DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], arrayStringNulls=[$1], uln=[$3], udn=[$4], druid=[logical]) + DruidFilter(condition=[OR(=($3, 1), =($4, 2.2))]) + DruidUnnest(unnestExpr=[$2]) + DruidProject(arrayString=[$0], arrayStringNulls=[$1], arrayDoubleNulls=[$3], uln=[$4], druid=[logical]) + DruidUnnest(unnestExpr=[$2]) + DruidFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + DruidProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "query", + "query" : { + "queryType" : "scan", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "unnest", + "base" : { + "type" : "filter", + "base" : { + "type" : "table", + "name" : "arrays" + }, + "filter" : { + "type" : "equals", + "column" : "arrayString", + "matchValueType" : "ARRAY", + "matchValue" : [ "a", "b" ] + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "\"arrayLongNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : null + }, + "virtualColumn" : { + "type" : "expression", + "name" : "_j0.unnest", + "expression" : "\"arrayDoubleNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : null + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "array('a','b')", + "outputType" : "ARRAY" + } ], + "resultFormat" : "compactedList", + "filter" : { + "type" : "or", + "fields" : [ { + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "LONG", + "matchValue" : 1 + }, { + "type" : "equals", + "column" : "_j0.unnest", + "matchValueType" : "DOUBLE", + "matchValue" : 2.2 + } ] + }, + "columns" : [ "v0", "arrayStringNulls", "j0.unnest", "_j0.unnest" ], + "columnTypes" : [ "ARRAY", "ARRAY", "LONG", "DOUBLE" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "__j0.unnest", + "expression" : "\"arrayStringNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "__j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "a" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "_v0", + "expression" : "array('a','b')", + "outputType" : "ARRAY" + } ], + "resultFormat" : "compactedList", + "columns" : [ "_v0", "j0.unnest", "_j0.unnest", "__j0.unnest" ], + "columnTypes" : [ "ARRAY", "LONG", "DOUBLE", "STRING" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq index dd3771f4b3b8..1c5cc69df960 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq @@ -20,18 +20,20 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (3 rows) !ok -LogicalProject(t=[$0], d3=[$3]) +LogicalProject(t=[$0], d3=[$2]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0]) - LogicalFilter(condition=[=($2, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$2]) + LogicalFilter(condition=[=($1, 'a')]) + LogicalProject(__time=[$0], dim2=[$2], dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$3], druid=[logical]) +DruidProject(t=[$0], d3=[$2], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($2, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$2], druid=[logical]) + DruidFilter(condition=[=($1, 'a')]) + DruidProject(__time=[$0], dim2=[$2], dim3=[$3], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { @@ -63,8 +65,8 @@ DruidProject(t=[$0], d3=[$3], druid=[logical]) "matchValueType" : "STRING", "matchValue" : "a" }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0", "dim3" ], + "columnTypes" : [ "LONG", "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq index 494dc9dc9d29..85f906bfae5d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq @@ -20,18 +20,20 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (3 rows) !ok -LogicalProject(t=[$0], d3=[$3]) +LogicalProject(t=[$0], d3=[$2]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0]) - LogicalFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$2]) + LogicalFilter(condition=[SEARCH($1, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) + LogicalProject(__time=[$0], dim2=[$2], dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$3], druid=[logical]) +DruidProject(t=[$0], d3=[$2], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0], druid=[logical]) - DruidFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$2], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) + DruidProject(__time=[$0], dim2=[$2], dim3=[$3], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { @@ -63,8 +65,8 @@ DruidProject(t=[$0], d3=[$3], druid=[logical]) "matchValueType" : "STRING", "sortedValues" : [ "a", "b" ] }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0", "dim3" ], + "columnTypes" : [ "LONG", "STRING" ], "granularity" : { "type" : "all" }, From fbfed8a07f986e01073d27fd4e088346158f1f6e Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 13 Nov 2024 18:09:50 +0000 Subject: [PATCH 29/99] update --- .../calcite/planner/CalciteRulesManager.java | 8 +++- .../rule/logical/UnnestInputCleanupRule.java | 3 +- .../sql/calcite/CalciteArraysQueryTest.java | 2 +- ...testUnnestExtractionFn@NullHandling=sql.iq | 41 +++++++++++++++---- ...ExpressionInInnerQuery@NullHandling=sql.iq | 19 +++++---- ...ExpressionInInnerQuery@NullHandling=sql.iq | 19 +++++---- ...tionsOfUnnestedColumns@NullHandling=sql.iq | 37 +++++++++++++---- ...iltersOnUnnestedColumn@NullHandling=sql.iq | 37 +++++++++++++---- 8 files changed, 126 insertions(+), 40 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index bfaa9b9de046..dbf3960352a4 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -39,6 +39,7 @@ import org.apache.calcite.rel.rules.DateRangeRules; import org.apache.calcite.rel.rules.FilterCorrelateRule; import org.apache.calcite.rel.rules.FilterJoinRule.FilterIntoJoinRule.FilterIntoJoinRuleConfig; +import org.apache.calcite.rel.rules.FilterProjectTransposeRule; import org.apache.calcite.rel.rules.JoinExtractFilterRule; import org.apache.calcite.rel.rules.JoinPushThroughJoinRule; import org.apache.calcite.rel.rules.ProjectMergeRule; @@ -285,13 +286,14 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); + builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); builder.addRuleInstance(new LogicalUnnestRule()); builder.addRuleInstance(new UnnestInputCleanupRule()); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(), + new DruidTrimFieldsProgram(true), Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE) ); } @@ -555,6 +557,10 @@ public RelNode run( /** Program that trims fields. */ private static class DruidTrimFieldsProgram implements Program { + public DruidTrimFieldsProgram(boolean trim) + { + } + @Override public RelNode run(RelOptPlanner planner, RelNode rel, RelTraitSet requiredOutputTraits, List materializations, diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index 80554c0ff45b..9290eb65bb15 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -146,12 +146,13 @@ public void onMatch(RelOptRuleCall call) private static class ExpressionPullerRexShuttle extends RexShuttle { private final List projects; + // FIXME: remove this crap private int replaceableIndex; private ExpressionPullerRexShuttle(List projects, int replaceableIndex) { this.projects = projects; - this.replaceableIndex = replaceableIndex; + this.replaceableIndex = -1; } @Override diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 8a53716cd9d5..d8772e21854f 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4890,7 +4890,7 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations() } // FIXME: thyis -// @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters() { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq index 902a04237d77..1256d9d2ab88 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq @@ -21,14 +21,14 @@ SELECT substring(d3,1) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested !ok LogicalProject(EXPR$0=[SUBSTRING($1, 1)]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>(SUBSTRING($0, 1), 'b')]) - LogicalProject(dim3=[$3]) + LogicalUnnest(unnestExpr=[$0], filter=[<>(SUBSTRING($0, 1), 'b')]) + LogicalProject($f17=[MV_TO_ARRAY($3)]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(EXPR$0=[SUBSTRING($1, 1)], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>(SUBSTRING($0, 1), 'b')]) - DruidProject(dim3=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[$0], filter=[<>(SUBSTRING($0, 1), 'b')]) + DruidProject($f17=[MV_TO_ARRAY($3)], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan @@ -37,13 +37,36 @@ DruidProject(EXPR$0=[SUBSTRING($1, 1)], druid=[logical]) "dataSource" : { "type" : "unnest", "base" : { - "type" : "table", - "name" : "numfoo" + "type" : "query", + "query" : { + "queryType" : "scan", + "dataSource" : { + "type" : "table", + "name" : "numfoo" + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "mv_to_array(\"dim3\")", + "outputType" : "ARRAY" + } ], + "resultFormat" : "compactedList", + "columns" : [ "v0" ], + "columnTypes" : [ "ARRAY" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false + } }, "virtualColumn" : { "type" : "expression", "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", + "expression" : "\"v0\"", "outputType" : "ARRAY" }, "unnestFilter" : { @@ -57,12 +80,12 @@ DruidProject(EXPR$0=[SUBSTRING($1, 1)], druid=[logical]) }, "virtualColumns" : [ { "type" : "expression", - "name" : "v0", + "name" : "_v0", "expression" : "substring(\"j0.unnest\", 0, -1)", "outputType" : "STRING" } ], "resultFormat" : "compactedList", - "columns" : [ "v0" ], + "columns" : [ "_v0" ], "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq index 1c5cc69df960..66733104a875 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq @@ -21,16 +21,16 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d !ok LogicalProject(t=[$0], d3=[$2]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$2]) + LogicalUnnest(unnestExpr=[$1]) + LogicalProject(t=[FLOOR($0, FLAG(HOUR))], $f2=[MV_TO_ARRAY($2)]) LogicalFilter(condition=[=($1, 'a')]) LogicalProject(__time=[$0], dim2=[$2], dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(t=[$0], d3=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[$1]) + DruidProject(t=[FLOOR($0, FLAG(HOUR))], $f2=[MV_TO_ARRAY($2)], druid=[logical]) DruidFilter(condition=[=($1, 'a')]) DruidProject(__time=[$0], dim2=[$2], dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -57,6 +57,11 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "name" : "v0", "expression" : "timestamp_floor(\"__time\",'PT1H',null,'UTC')", "outputType" : "LONG" + }, { + "type" : "expression", + "name" : "v1", + "expression" : "mv_to_array(\"dim3\")", + "outputType" : "ARRAY" } ], "resultFormat" : "compactedList", "filter" : { @@ -65,8 +70,8 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "matchValueType" : "STRING", "matchValue" : "a" }, - "columns" : [ "v0", "dim3" ], - "columnTypes" : [ "LONG", "STRING" ], + "columns" : [ "v0", "v1" ], + "columnTypes" : [ "LONG", "ARRAY" ], "granularity" : { "type" : "all" }, @@ -76,7 +81,7 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "virtualColumn" : { "type" : "expression", "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", + "expression" : "\"v1\"", "outputType" : "ARRAY" }, "unnestFilter" : null diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq index 85f906bfae5d..164e1d8e5b60 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq @@ -21,16 +21,16 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d !ok LogicalProject(t=[$0], d3=[$2]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$2]) + LogicalUnnest(unnestExpr=[$1]) + LogicalProject(t=[FLOOR($0, FLAG(HOUR))], $f2=[MV_TO_ARRAY($2)]) LogicalFilter(condition=[SEARCH($1, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) LogicalProject(__time=[$0], dim2=[$2], dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(t=[$0], d3=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[$1]) + DruidProject(t=[FLOOR($0, FLAG(HOUR))], $f2=[MV_TO_ARRAY($2)], druid=[logical]) DruidFilter(condition=[SEARCH($1, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) DruidProject(__time=[$0], dim2=[$2], dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -57,6 +57,11 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "name" : "v0", "expression" : "timestamp_floor(\"__time\",'PT1H',null,'UTC')", "outputType" : "LONG" + }, { + "type" : "expression", + "name" : "v1", + "expression" : "mv_to_array(\"dim3\")", + "outputType" : "ARRAY" } ], "resultFormat" : "compactedList", "filter" : { @@ -65,8 +70,8 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "matchValueType" : "STRING", "sortedValues" : [ "a", "b" ] }, - "columns" : [ "v0", "dim3" ], - "columnTypes" : [ "LONG", "STRING" ], + "columns" : [ "v0", "v1" ], + "columnTypes" : [ "LONG", "ARRAY" ], "granularity" : { "type" : "all" }, @@ -76,7 +81,7 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "virtualColumn" : { "type" : "expression", "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", + "expression" : "\"v1\"", "outputType" : "ARRAY" }, "unnestFilter" : null diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq index 40527edea4c4..6464f2fab3b4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq @@ -24,14 +24,14 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where st !ok LogicalProject(d3=[$1]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - LogicalProject(dim3=[$3]) + LogicalUnnest(unnestExpr=[$0], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) + LogicalProject($f17=[MV_TO_ARRAY($3)]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(d3=[$1], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - DruidProject(dim3=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[$0], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) + DruidProject($f17=[MV_TO_ARRAY($3)], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan @@ -40,13 +40,36 @@ DruidProject(d3=[$1], druid=[logical]) "dataSource" : { "type" : "unnest", "base" : { - "type" : "table", - "name" : "numfoo" + "type" : "query", + "query" : { + "queryType" : "scan", + "dataSource" : { + "type" : "table", + "name" : "numfoo" + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "mv_to_array(\"dim3\")", + "outputType" : "ARRAY" + } ], + "resultFormat" : "compactedList", + "columns" : [ "v0" ], + "columnTypes" : [ "ARRAY" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false + } }, "virtualColumn" : { "type" : "expression", "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", + "expression" : "\"v0\"", "outputType" : "ARRAY" }, "unnestFilter" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq index c2337e90168a..ef2f872aa67e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq @@ -23,14 +23,14 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3 !ok LogicalProject(d3=[$1]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>($0, 'd')]) - LogicalProject(dim3=[$3]) + LogicalUnnest(unnestExpr=[$0], filter=[<>($0, 'd')]) + LogicalProject($f17=[MV_TO_ARRAY($3)]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(d3=[$1], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>($0, 'd')]) - DruidProject(dim3=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[$0], filter=[<>($0, 'd')]) + DruidProject($f17=[MV_TO_ARRAY($3)], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan @@ -39,13 +39,36 @@ DruidProject(d3=[$1], druid=[logical]) "dataSource" : { "type" : "unnest", "base" : { - "type" : "table", - "name" : "numfoo" + "type" : "query", + "query" : { + "queryType" : "scan", + "dataSource" : { + "type" : "table", + "name" : "numfoo" + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "mv_to_array(\"dim3\")", + "outputType" : "ARRAY" + } ], + "resultFormat" : "compactedList", + "columns" : [ "v0" ], + "columnTypes" : [ "ARRAY" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false + } }, "virtualColumn" : { "type" : "expression", "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", + "expression" : "\"v0\"", "outputType" : "ARRAY" }, "unnestFilter" : { From f4d7ec269517704a4d61ec65a17ccce169901dcf Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 07:51:22 +0000 Subject: [PATCH 30/99] cleanup/enhance rule order to simplify --- .../calcite/planner/CalciteRulesManager.java | 7 +- .../rule/logical/UnnestInputCleanupRule.java | 11 -- .../sql/calcite/CalciteArraysQueryTest.java | 3 +- ...sArrayColumnsOrFilters@NullHandling=sql.iq | 136 ++++++++---------- 4 files changed, 64 insertions(+), 93 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index dbf3960352a4..34d527cb1227 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -289,12 +289,13 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); - builder.addRuleInstance(new LogicalUnnestRule()); - builder.addRuleInstance(new UnnestInputCleanupRule()); + final HepProgramBuilder builder2 = HepProgram.builder(); + builder2.addRuleInstance(new LogicalUnnestRule()); + builder2.addRuleInstance(new UnnestInputCleanupRule()); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), new DruidTrimFieldsProgram(true), - Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE) + Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE) ); } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index 9290eb65bb15..e611f3a6e2b0 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -26,7 +26,6 @@ import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.Project; import org.apache.calcite.rel.rules.SubstitutionRule; -import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rex.RexBuilder; import org.apache.calcite.rex.RexInputRef; import org.apache.calcite.rex.RexNode; @@ -125,7 +124,6 @@ public void onMatch(RelOptRuleCall call) for (int i = 0; i < hideCount; i++) { projectFields.remove(unnest.getRowType().getFieldCount() - 2); } - RelDataType type = oldProject.getProjects().get(inputIndex).getType(); projectFields.set( inputIndex, @@ -146,13 +144,10 @@ public void onMatch(RelOptRuleCall call) private static class ExpressionPullerRexShuttle extends RexShuttle { private final List projects; - // FIXME: remove this crap - private int replaceableIndex; private ExpressionPullerRexShuttle(List projects, int replaceableIndex) { this.projects = projects; - this.replaceableIndex = -1; } @Override @@ -160,14 +155,8 @@ public RexNode visitInputRef(RexInputRef inputRef) { int newIndex = projects.indexOf(inputRef); if (newIndex < 0) { - if (replaceableIndex >= 0) { - newIndex = replaceableIndex; - projects.set(replaceableIndex, inputRef); - replaceableIndex = -1; - } else { newIndex = projects.size(); projects.add(inputRef); - } } if (newIndex == inputRef.getIndex()) { return inputRef; diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index d8772e21854f..0b8e5d953f07 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4889,8 +4889,7 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations() ); } - // FIXME: thyis - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters() { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq index a31d4d142c97..17f257194393 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq @@ -25,28 +25,30 @@ (5 rows) !ok -LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$2], udn=[$3], usn=[$4]) - LogicalUnnest(unnestExpr=[$1], filter=[=($0, 'a')]) - LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], arrayStringNulls=[$1], uln=[$3], udn=[$4]) - LogicalFilter(condition=[OR(=($3, 1), =($4, 2.2))]) - LogicalUnnest(unnestExpr=[$2]) - LogicalProject(arrayString=[$0], arrayStringNulls=[$1], arrayDoubleNulls=[$3], uln=[$4]) - LogicalUnnest(unnestExpr=[$2]) - LogicalFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - LogicalProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) - LogicalTableScan(table=[[druid, arrays]]) +LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3]) + LogicalUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) + LogicalProject(arrayStringNulls=[$0], uln=[$2], udn=[$3]) + LogicalFilter(condition=[OR(=($2, 1), =($3, 2.2))]) + LogicalUnnest(unnestExpr=[$1]) + LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3]) + LogicalUnnest(unnestExpr=[$1]) + LogicalProject(arrayStringNulls=[$1], arrayLongNulls=[$2], arrayDoubleNulls=[$3]) + LogicalFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + LogicalProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) + LogicalTableScan(table=[[druid, arrays]]) !logicalPlan -DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$2], udn=[$3], usn=[$4], druid=[logical]) - DruidUnnest(unnestExpr=[$1], filter=[=($0, 'a')]) - DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], arrayStringNulls=[$1], uln=[$3], udn=[$4], druid=[logical]) - DruidFilter(condition=[OR(=($3, 1), =($4, 2.2))]) - DruidUnnest(unnestExpr=[$2]) - DruidProject(arrayString=[$0], arrayStringNulls=[$1], arrayDoubleNulls=[$3], uln=[$4], druid=[logical]) - DruidUnnest(unnestExpr=[$2]) - DruidFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - DruidProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) - DruidTableScan(table=[[druid, arrays]], druid=[logical]) +DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) + DruidProject(arrayStringNulls=[$0], uln=[$2], udn=[$3], druid=[logical]) + DruidFilter(condition=[OR(=($2, 1), =($3, 2.2))]) + DruidUnnest(unnestExpr=[$1]) + DruidProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[$1]) + DruidProject(arrayStringNulls=[$1], arrayLongNulls=[$2], arrayDoubleNulls=[$3], druid=[logical]) + DruidFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + DruidProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) !druidPlan { @@ -54,73 +56,53 @@ DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], "dataSource" : { "type" : "unnest", "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { + "type" : "filter", + "base" : { + "type" : "unnest", + "base" : { "type" : "unnest", "base" : { - "type" : "unnest", + "type" : "filter", "base" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "arrays" - }, - "filter" : { - "type" : "equals", - "column" : "arrayString", - "matchValueType" : "ARRAY", - "matchValue" : [ "a", "b" ] - } + "type" : "table", + "name" : "arrays" }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "\"arrayLongNulls\"", - "outputType" : "ARRAY" - }, - "unnestFilter" : null + "filter" : { + "type" : "equals", + "column" : "arrayString", + "matchValueType" : "ARRAY", + "matchValue" : [ "a", "b" ] + } }, "virtualColumn" : { "type" : "expression", - "name" : "_j0.unnest", - "expression" : "\"arrayDoubleNulls\"", - "outputType" : "ARRAY" + "name" : "j0.unnest", + "expression" : "\"arrayLongNulls\"", + "outputType" : "ARRAY" }, "unnestFilter" : null }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { + "virtualColumn" : { "type" : "expression", - "name" : "v0", - "expression" : "array('a','b')", - "outputType" : "ARRAY" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "equals", - "column" : "j0.unnest", - "matchValueType" : "LONG", - "matchValue" : 1 - }, { - "type" : "equals", - "column" : "_j0.unnest", - "matchValueType" : "DOUBLE", - "matchValue" : 2.2 - } ] - }, - "columns" : [ "v0", "arrayStringNulls", "j0.unnest", "_j0.unnest" ], - "columnTypes" : [ "ARRAY", "ARRAY", "LONG", "DOUBLE" ], - "granularity" : { - "type" : "all" + "name" : "_j0.unnest", + "expression" : "\"arrayDoubleNulls\"", + "outputType" : "ARRAY" }, - "legacy" : false + "unnestFilter" : null + }, + "filter" : { + "type" : "or", + "fields" : [ { + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "LONG", + "matchValue" : 1 + }, { + "type" : "equals", + "column" : "_j0.unnest", + "matchValueType" : "DOUBLE", + "matchValue" : 2.2 + } ] } }, "virtualColumn" : { @@ -142,12 +124,12 @@ DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], }, "virtualColumns" : [ { "type" : "expression", - "name" : "_v0", + "name" : "v0", "expression" : "array('a','b')", "outputType" : "ARRAY" } ], "resultFormat" : "compactedList", - "columns" : [ "_v0", "j0.unnest", "_j0.unnest", "__j0.unnest" ], + "columns" : [ "v0", "j0.unnest", "_j0.unnest", "__j0.unnest" ], "columnTypes" : [ "ARRAY", "LONG", "DOUBLE", "STRING" ], "granularity" : { "type" : "all" From fd564fda720a8ddbf24828130d8470474c1ceddc Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 09:07:44 +0000 Subject: [PATCH 31/99] cleanup/enhance rule order to simplify --- .../calcite/planner/CalciteRulesManager.java | 12 +++-- .../calcite/planner/DruidRelFieldTrimmer.java | 5 ++- ...testUnnestExtractionFn@NullHandling=sql.iq | 45 +++++-------------- ...sArrayColumnsOrFilters@NullHandling=sql.iq | 18 ++++---- ...ExpressionInInnerQuery@NullHandling=sql.iq | 33 ++++++-------- ...ExpressionInInnerQuery@NullHandling=sql.iq | 33 ++++++-------- ...tionsOfUnnestedColumns@NullHandling=sql.iq | 41 ++++------------- ...iltersOnUnnestedColumn@NullHandling=sql.iq | 41 ++++------------- 8 files changed, 75 insertions(+), 153 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 34d527cb1227..de0d40cc5f95 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -292,9 +292,11 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC final HepProgramBuilder builder2 = HepProgram.builder(); builder2.addRuleInstance(new LogicalUnnestRule()); builder2.addRuleInstance(new UnnestInputCleanupRule()); + builder2.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); + builder2.addRuleInstance(CoreRules.PROJECT_MERGE); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(true), + new DruidTrimFieldsProgram(false), Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE) ); } @@ -558,8 +560,11 @@ public RelNode run( /** Program that trims fields. */ private static class DruidTrimFieldsProgram implements Program { + private boolean trim; + public DruidTrimFieldsProgram(boolean trim) { + this.trim = trim; } @Override public RelNode run(RelOptPlanner planner, RelNode rel, @@ -568,7 +573,8 @@ public DruidTrimFieldsProgram(boolean trim) List lattices) { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); - return runFieldTrimmer(relBuilder, rel); + RelNode ret = new DruidRelFieldTrimmer(null, relBuilder, trim).trim(rel); + return ret; } } @@ -583,7 +589,7 @@ private static RelNode runFieldTrimmer2(RelBuilder relBuilder, RelNode decorrela private static RelNode runFieldTrimmer(final RelBuilder relBuilder, final RelNode decorrelatedRel) { if(true) { - return new DruidRelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); + return new DruidRelFieldTrimmer(null, relBuilder,true).trim(decorrelatedRel); } else { return new RelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 9c47d2777f20..f313f2651579 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -48,12 +48,13 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer { private RelBuilder relBuilder; - private boolean trimTableScan = true; + private boolean trimTableScan; - public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuilder) + public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuilder, boolean trimTableScan) { super(validator, relBuilder); this.relBuilder = relBuilder; + this.trimTableScan= trimTableScan; } @Override diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq index 1256d9d2ab88..ab1155737d5a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq @@ -20,15 +20,15 @@ SELECT substring(d3,1) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (3 rows) !ok -LogicalProject(EXPR$0=[SUBSTRING($1, 1)]) - LogicalUnnest(unnestExpr=[$0], filter=[<>(SUBSTRING($0, 1), 'b')]) - LogicalProject($f17=[MV_TO_ARRAY($3)]) +LogicalProject(EXPR$0=[SUBSTRING($2, 1)]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[<>(SUBSTRING($0, 1), 'b')]) + LogicalProject(__time=[$0], dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(EXPR$0=[SUBSTRING($1, 1)], druid=[logical]) - DruidUnnest(unnestExpr=[$0], filter=[<>(SUBSTRING($0, 1), 'b')]) - DruidProject($f17=[MV_TO_ARRAY($3)], druid=[logical]) +DruidProject(EXPR$0=[SUBSTRING($2, 1)], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[<>(SUBSTRING($0, 1), 'b')]) + DruidProject(__time=[$0], dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan @@ -37,36 +37,13 @@ DruidProject(EXPR$0=[SUBSTRING($1, 1)], druid=[logical]) "dataSource" : { "type" : "unnest", "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - } ], - "resultFormat" : "compactedList", - "columns" : [ "v0" ], - "columnTypes" : [ "ARRAY" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "table", + "name" : "numfoo" }, "virtualColumn" : { "type" : "expression", "name" : "j0.unnest", - "expression" : "\"v0\"", + "expression" : "mv_to_array(\"dim3\")", "outputType" : "ARRAY" }, "unnestFilter" : { @@ -80,12 +57,12 @@ DruidProject(EXPR$0=[SUBSTRING($1, 1)], druid=[logical]) }, "virtualColumns" : [ { "type" : "expression", - "name" : "_v0", + "name" : "v0", "expression" : "substring(\"j0.unnest\", 0, -1)", "outputType" : "STRING" } ], "resultFormat" : "compactedList", - "columns" : [ "_v0" ], + "columns" : [ "v0" ], "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq index 17f257194393..eea95e1c8fa0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq @@ -1,5 +1,5 @@ -# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql case-crc:727a851b -# quidem testcase reason: UNNEST_EXTRA_SCAN +# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql case-crc:8bc6fb6b +# quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 !set maxScatterGatherBytes 9223372036854775807 @@ -32,10 +32,9 @@ LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY] LogicalUnnest(unnestExpr=[$1]) LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3]) LogicalUnnest(unnestExpr=[$1]) - LogicalProject(arrayStringNulls=[$1], arrayLongNulls=[$2], arrayDoubleNulls=[$3]) - LogicalFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - LogicalProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) - LogicalTableScan(table=[[druid, arrays]]) + LogicalProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) + LogicalFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + LogicalTableScan(table=[[druid, arrays]]) !logicalPlan DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3], druid=[logical]) @@ -45,10 +44,9 @@ DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], DruidUnnest(unnestExpr=[$1]) DruidProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3], druid=[logical]) DruidUnnest(unnestExpr=[$1]) - DruidProject(arrayStringNulls=[$1], arrayLongNulls=[$2], arrayDoubleNulls=[$3], druid=[logical]) - DruidFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - DruidProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) - DruidTableScan(table=[[druid, arrays]], druid=[logical]) + DruidProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) + DruidFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq index 66733104a875..e276758fb75f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq @@ -20,20 +20,18 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (3 rows) !ok -LogicalProject(t=[$0], d3=[$2]) - LogicalUnnest(unnestExpr=[$1]) - LogicalProject(t=[FLOOR($0, FLAG(HOUR))], $f2=[MV_TO_ARRAY($2)]) - LogicalFilter(condition=[=($1, 'a')]) - LogicalProject(__time=[$0], dim2=[$2], dim3=[$3]) - LogicalTableScan(table=[[druid, numfoo]]) +LogicalProject(t=[$0], d3=[$3]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($2)]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], __time=[$0], dim3=[$3]) + LogicalFilter(condition=[=($2, 'a')]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[$1]) - DruidProject(t=[FLOOR($0, FLAG(HOUR))], $f2=[MV_TO_ARRAY($2)], druid=[logical]) - DruidFilter(condition=[=($1, 'a')]) - DruidProject(__time=[$0], dim2=[$2], dim3=[$3], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) +DruidProject(t=[$0], d3=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($2)]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], __time=[$0], dim3=[$3], druid=[logical]) + DruidFilter(condition=[=($2, 'a')]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { @@ -57,11 +55,6 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "name" : "v0", "expression" : "timestamp_floor(\"__time\",'PT1H',null,'UTC')", "outputType" : "LONG" - }, { - "type" : "expression", - "name" : "v1", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" } ], "resultFormat" : "compactedList", "filter" : { @@ -70,8 +63,8 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "matchValueType" : "STRING", "matchValue" : "a" }, - "columns" : [ "v0", "v1" ], - "columnTypes" : [ "LONG", "ARRAY" ], + "columns" : [ "v0", "__time", "dim3" ], + "columnTypes" : [ "LONG", "LONG", "STRING" ], "granularity" : { "type" : "all" }, @@ -81,7 +74,7 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "virtualColumn" : { "type" : "expression", "name" : "j0.unnest", - "expression" : "\"v1\"", + "expression" : "mv_to_array(\"dim3\")", "outputType" : "ARRAY" }, "unnestFilter" : null diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq index 164e1d8e5b60..281bca5af54f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq @@ -20,20 +20,18 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (3 rows) !ok -LogicalProject(t=[$0], d3=[$2]) - LogicalUnnest(unnestExpr=[$1]) - LogicalProject(t=[FLOOR($0, FLAG(HOUR))], $f2=[MV_TO_ARRAY($2)]) - LogicalFilter(condition=[SEARCH($1, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim2=[$2], dim3=[$3]) - LogicalTableScan(table=[[druid, numfoo]]) +LogicalProject(t=[$0], d3=[$3]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($2)]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], __time=[$0], dim3=[$3]) + LogicalFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[$1]) - DruidProject(t=[FLOOR($0, FLAG(HOUR))], $f2=[MV_TO_ARRAY($2)], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim2=[$2], dim3=[$3], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) +DruidProject(t=[$0], d3=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($2)]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], __time=[$0], dim3=[$3], druid=[logical]) + DruidFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { @@ -57,11 +55,6 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "name" : "v0", "expression" : "timestamp_floor(\"__time\",'PT1H',null,'UTC')", "outputType" : "LONG" - }, { - "type" : "expression", - "name" : "v1", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" } ], "resultFormat" : "compactedList", "filter" : { @@ -70,8 +63,8 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "matchValueType" : "STRING", "sortedValues" : [ "a", "b" ] }, - "columns" : [ "v0", "v1" ], - "columnTypes" : [ "LONG", "ARRAY" ], + "columns" : [ "v0", "__time", "dim3" ], + "columnTypes" : [ "LONG", "LONG", "STRING" ], "granularity" : { "type" : "all" }, @@ -81,7 +74,7 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "virtualColumn" : { "type" : "expression", "name" : "j0.unnest", - "expression" : "\"v1\"", + "expression" : "mv_to_array(\"dim3\")", "outputType" : "ARRAY" }, "unnestFilter" : null diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq index 6464f2fab3b4..bd6baaf3a5ac 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq @@ -23,15 +23,15 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where st (6 rows) !ok -LogicalProject(d3=[$1]) - LogicalUnnest(unnestExpr=[$0], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - LogicalProject($f17=[MV_TO_ARRAY($3)]) +LogicalProject(d3=[$2]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) + LogicalProject(__time=[$0], dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(d3=[$1], druid=[logical]) - DruidUnnest(unnestExpr=[$0], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - DruidProject($f17=[MV_TO_ARRAY($3)], druid=[logical]) +DruidProject(d3=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) + DruidProject(__time=[$0], dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan @@ -40,36 +40,13 @@ DruidProject(d3=[$1], druid=[logical]) "dataSource" : { "type" : "unnest", "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - } ], - "resultFormat" : "compactedList", - "columns" : [ "v0" ], - "columnTypes" : [ "ARRAY" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "table", + "name" : "numfoo" }, "virtualColumn" : { "type" : "expression", "name" : "j0.unnest", - "expression" : "\"v0\"", + "expression" : "mv_to_array(\"dim3\")", "outputType" : "ARRAY" }, "unnestFilter" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq index ef2f872aa67e..5010184f669d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq @@ -22,15 +22,15 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3 (5 rows) !ok -LogicalProject(d3=[$1]) - LogicalUnnest(unnestExpr=[$0], filter=[<>($0, 'd')]) - LogicalProject($f17=[MV_TO_ARRAY($3)]) +LogicalProject(d3=[$2]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[<>($0, 'd')]) + LogicalProject(__time=[$0], dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(d3=[$1], druid=[logical]) - DruidUnnest(unnestExpr=[$0], filter=[<>($0, 'd')]) - DruidProject($f17=[MV_TO_ARRAY($3)], druid=[logical]) +DruidProject(d3=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[<>($0, 'd')]) + DruidProject(__time=[$0], dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan @@ -39,36 +39,13 @@ DruidProject(d3=[$1], druid=[logical]) "dataSource" : { "type" : "unnest", "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - } ], - "resultFormat" : "compactedList", - "columns" : [ "v0" ], - "columnTypes" : [ "ARRAY" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "table", + "name" : "numfoo" }, "virtualColumn" : { "type" : "expression", "name" : "j0.unnest", - "expression" : "\"v0\"", + "expression" : "mv_to_array(\"dim3\")", "outputType" : "ARRAY" }, "unnestFilter" : { From 9448ed3825b85aff58724add8231085f847a18d0 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 09:53:17 +0000 Subject: [PATCH 32/99] enable trim for unnest --- .../calcite/planner/CalciteRulesManager.java | 3 +- .../calcite/planner/DruidRelFieldTrimmer.java | 75 +++++++++++++++++-- .../calcite/rule/logical/LogicalUnnest.java | 10 ++- .../sql/calcite/rule/logical/Unnest.java | 5 ++ ...ExpressionInInnerQuery@NullHandling=sql.iq | 16 ++-- ...ExpressionInInnerQuery@NullHandling=sql.iq | 16 ++-- 6 files changed, 99 insertions(+), 26 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index de0d40cc5f95..20b51f1e5251 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -297,7 +297,8 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), new DruidTrimFieldsProgram(false), - Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE) + Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE), + new DruidTrimFieldsProgram(false) ); } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index f313f2651579..2484e541fa2c 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -19,6 +19,8 @@ package org.apache.druid.sql.calcite.planner; +import com.google.common.collect.ImmutableList; +import org.apache.calcite.plan.RelOptUtil; import org.apache.calcite.rel.RelHomogeneousShuttle; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.CorrelationId; @@ -30,7 +32,9 @@ import org.apache.calcite.rex.RexCorrelVariable; import org.apache.calcite.rex.RexFieldAccess; import org.apache.calcite.rex.RexNode; +import org.apache.calcite.rex.RexPermuteInputsShuttle; import org.apache.calcite.rex.RexShuttle; +import org.apache.calcite.rex.RexVisitor; import org.apache.calcite.sql.validate.SqlValidator; import org.apache.calcite.sql2rel.RelFieldTrimmer; import org.apache.calcite.tools.RelBuilder; @@ -39,6 +43,7 @@ import org.apache.calcite.util.mapping.Mapping; import org.apache.calcite.util.mapping.MappingType; import org.apache.calcite.util.mapping.Mappings; +import org.apache.druid.sql.calcite.rule.logical.LogicalUnnest; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; @@ -54,25 +59,26 @@ public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuil { super(validator, relBuilder); this.relBuilder = relBuilder; - this.trimTableScan= trimTableScan; + this.trimTableScan = trimTableScan; } @Override protected TrimResult dummyProject(int fieldCount, RelNode input) { Mapping mapping = Mappings.createIdentity(input.getRowType().getFieldCount()); -// mapping = Mappings.create( -// MappingType.INVERSE_SURJECTION, -// fieldCount, -// 0 -// ); + // mapping = Mappings.create( + // MappingType.INVERSE_SURJECTION, + // fieldCount, + // 0 + // ); return result(input, mapping); } public TrimResult trimFields( final TableScan tableAccessRel, ImmutableBitSet fieldsUsed, - Set extraFields) { + Set extraFields) + { if (trimTableScan) { return super.trimFields(tableAccessRel, fieldsUsed, extraFields); } else { @@ -81,7 +87,6 @@ public TrimResult trimFields( } } - public TrimResult trimFields(LogicalCorrelate correlate, ImmutableBitSet fieldsUsed, Set extraFields) @@ -153,6 +158,60 @@ public TrimResult trimFields(LogicalCorrelate correlate, return result(newCorrelate, mapping); } + public TrimResult trimFields(LogicalUnnest correlate, + ImmutableBitSet fieldsUsed, + Set extraFields) + { + if (!extraFields.isEmpty()) { + // bail out with generic trim + return trimFields((RelNode) correlate, fieldsUsed, extraFields); + } + RelOptUtil.InputFinder inputFinder = new RelOptUtil.InputFinder(extraFields); + + correlate.getUnnestExpr().accept(inputFinder); + if (correlate.getFilter() != null) { + correlate.getFilter().accept(inputFinder); + } + + ImmutableBitSet finderFields = inputFinder.build(); + + ImmutableBitSet inputFieldsUsed = ImmutableBitSet.builder() + .addAll(fieldsUsed.clear(correlate.getRowType().getFieldCount() - 1)) + .addAll(finderFields) + .build(); + + RelNode input = correlate.getInput(); + // Create input with trimmed columns. + TrimResult trimResult = trimChild(correlate, input, inputFieldsUsed, extraFields); + + RelNode newInput = trimResult.left; + final Mapping inputMapping = trimResult.right; + + if (newInput == input) { + return result(correlate, Mappings.createIdentity(correlate.getRowType().getFieldCount())); + + } + + Mapping mapping = makeMapping(ImmutableList.of(inputMapping, Mappings.createIdentity(1))); + + final RexVisitor shuttle = new RexPermuteInputsShuttle(inputMapping, newInput); + + RexNode newUnnestExpr = correlate.getUnnestExpr().accept(shuttle); + RexNode newFilterExpr = null; + if (correlate.getFilter() != null) { + newFilterExpr = correlate.getFilter().accept(shuttle); + } + + final LogicalUnnest newCorrelate = correlate.copy( + correlate.getTraitSet(), + newInput, + newUnnestExpr, + newFilterExpr + ); + + return result(newCorrelate, mapping); + } + /** * Concatenates multiple mapping. * diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnest.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnest.java index 2768b1902a1e..3afb6a864808 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnest.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnest.java @@ -34,8 +34,16 @@ protected LogicalUnnest(RelOptCluster cluster, RelTraitSet traits, RelNode input } @Override - protected RelNode copy(RelTraitSet traitSet, RelNode input) + public RelNode copy(RelTraitSet traitSet, RelNode input) { return new LogicalUnnest(getCluster(), traitSet, input, unnestExpr, unnestFieldType, filter); } + + + public LogicalUnnest copy(RelTraitSet traitSet, RelNode input, RexNode newUnnestExpr, RexNode newFilter) + { + return new LogicalUnnest(getCluster(), traitSet, input, newUnnestExpr, unnestFieldType, newFilter); + } + + } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java index 69c4a80a65ae..21c3f9520612 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java @@ -61,6 +61,11 @@ public final RexNode getUnnestExpr() return unnestExpr; } + public RexNode getFilter() + { + return filter; + } + @Override public RelWriter explainTerms(RelWriter pw) { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq index e276758fb75f..adb6de02fcb8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=sql.iq @@ -20,16 +20,16 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (3 rows) !ok -LogicalProject(t=[$0], d3=[$3]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($2)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], __time=[$0], dim3=[$3]) +LogicalProject(t=[$0], d3=[$2]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3]) LogicalFilter(condition=[=($2, 'a')]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$3], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($2)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], __time=[$0], dim3=[$3], druid=[logical]) +DruidProject(t=[$0], d3=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], druid=[logical]) DruidFilter(condition=[=($2, 'a')]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -63,8 +63,8 @@ DruidProject(t=[$0], d3=[$3], druid=[logical]) "matchValueType" : "STRING", "matchValue" : "a" }, - "columns" : [ "v0", "__time", "dim3" ], - "columnTypes" : [ "LONG", "LONG", "STRING" ], + "columns" : [ "v0", "dim3" ], + "columnTypes" : [ "LONG", "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq index 281bca5af54f..d171843a0465 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=sql.iq @@ -20,16 +20,16 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (3 rows) !ok -LogicalProject(t=[$0], d3=[$3]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($2)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], __time=[$0], dim3=[$3]) +LogicalProject(t=[$0], d3=[$2]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3]) LogicalFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$3], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($2)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], __time=[$0], dim3=[$3], druid=[logical]) +DruidProject(t=[$0], d3=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], druid=[logical]) DruidFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -63,8 +63,8 @@ DruidProject(t=[$0], d3=[$3], druid=[logical]) "matchValueType" : "STRING", "sortedValues" : [ "a", "b" ] }, - "columns" : [ "v0", "__time", "dim3" ], - "columnTypes" : [ "LONG", "LONG", "STRING" ], + "columns" : [ "v0", "dim3" ], + "columnTypes" : [ "LONG", "STRING" ], "granularity" : { "type" : "all" }, From 9afdfb2dcf647b0ec5cd6a6115f168dc24d2b196 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 10:03:28 +0000 Subject: [PATCH 33/99] updates --- .../sql/calcite/CalciteArraysQueryTest.java | 5 + ...estColumnsArrayColumns@NullHandling=sql.iq | 128 +++++++++++++++++ ...tColumnsORCombinations@NullHandling=sql.iq | 134 ++++++++++++++++++ .../testUnnestWithGroupByHavingSelector.iq | 77 ++++++++++ ...hWhereOnUnnestArrayCol@NullHandling=sql.iq | 75 ++++++++++ ...ngWithWhereOnUnnestCol@NullHandling=sql.iq | 77 ++++++++++ 6 files changed, 496 insertions(+) create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=sql.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=sql.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=sql.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 0b8e5d953f07..756b070ff247 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4754,6 +4754,7 @@ public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumns() ); } + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns() { @@ -4821,6 +4822,7 @@ public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns() ); } + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) @Test public void testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations() { @@ -6416,6 +6418,7 @@ public void testUnnestWithCountOnColumn() ); } + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) @Test public void testUnnestWithGroupByHavingSelector() { @@ -6555,6 +6558,7 @@ public void testUnnestWithGroupByHavingWithWhereOnAggCol() ); } + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) @Test public void testUnnestWithGroupByHavingWithWhereOnUnnestCol() { @@ -6614,6 +6618,7 @@ public void testUnnestWithGroupByWithWhereOnUnnestArrayCol() ); } + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) @Test public void testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol() { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=sql.iq new file mode 100644 index 000000000000..f3f49221becb --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=sql.iq @@ -0,0 +1,128 @@ +# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=sql case-crc:84cffaf8 +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// + SELECT arrayString, uln, udn, usn FROM + ( SELECT * FROM + ( SELECT * FROM arrays, UNNEST(arrayLongNulls) as ut(uln)) ,UNNEST(arrayDoubleNulls) as ut(udn) + ), UNNEST(arrayStringNulls) as ut(usn) WHERE arrayString = ARRAY['a','b'] AND uln = 1 AND udn = 2.2 AND usn = 'a'; ++-------------+-----+-----+-----+ +| arrayString | uln | udn | usn | ++-------------+-----+-----+-----+ ++-------------+-----+-----+-----+ +(0 rows) + +!ok +LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[CAST(1:BIGINT):BIGINT], udn=[$1], usn=[$2]) + LogicalUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) + LogicalProject(arrayStringNulls=[$0], udn=[$2]) + LogicalUnnest(unnestExpr=[$1], filter=[=($0, 2.2)]) + LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2]) + LogicalUnnest(unnestExpr=[$1], filter=[=($0, 1)]) + LogicalProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) + LogicalFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + LogicalTableScan(table=[[druid, arrays]]) + +!logicalPlan +DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[CAST(1:BIGINT):BIGINT], udn=[$1], usn=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) + DruidProject(arrayStringNulls=[$0], udn=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[$1], filter=[=($0, 2.2)]) + DruidProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[$1], filter=[=($0, 1)]) + DruidProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) + DruidFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "unnest", + "base" : { + "type" : "unnest", + "base" : { + "type" : "filter", + "base" : { + "type" : "table", + "name" : "arrays" + }, + "filter" : { + "type" : "equals", + "column" : "arrayString", + "matchValueType" : "ARRAY", + "matchValue" : [ "a", "b" ] + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "\"arrayLongNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "LONG", + "matchValue" : 1 + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "\"arrayDoubleNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "DOUBLE", + "matchValue" : 2.2 + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "_j0.unnest", + "expression" : "\"arrayStringNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "_j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "a" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "array('a','b')", + "outputType" : "ARRAY" + }, { + "type" : "expression", + "name" : "v1", + "expression" : "1", + "outputType" : "LONG" + } ], + "resultFormat" : "compactedList", + "columns" : [ "v0", "v1", "j0.unnest", "_j0.unnest" ], + "columnTypes" : [ "ARRAY", "LONG", "DOUBLE", "STRING" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=sql.iq new file mode 100644 index 000000000000..2f67ac598954 --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=sql.iq @@ -0,0 +1,134 @@ +# testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=sql case-crc:b18b7dbe +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// + SELECT dimZipf, dim3_unnest1, dim3_unnest2, dim3_unnest3 FROM + ( SELECT * FROM + ( SELECT * FROM lotsocolumns, UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest1) ) ,UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest2) + ), UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest3) WHERE dimZipf=27 AND (dim3_unnest1='Baz' OR dim3_unnest2='Hello') AND dim3_unnest3='World'; ++---------+--------------+--------------+--------------+ +| dimZipf | dim3_unnest1 | dim3_unnest2 | dim3_unnest3 | ++---------+--------------+--------------+--------------+ +| 27 | Baz | Baz | World | +| 27 | Baz | Baz | World | +| 27 | Baz | Baz | World | +| 27 | Baz | Baz | World | +| 27 | Baz | Hello | World | +| 27 | Baz | Hello | World | +| 27 | Baz | World | World | +| 27 | Baz | World | World | +| 27 | Hello | Hello | World | +| 27 | World | Hello | World | ++---------+--------------+--------------+--------------+ +(10 rows) + +!ok +LogicalProject(dimZipf=[$0], dim3_unnest1=[$1], dim3_unnest2=[$2], dim3_unnest3=[$4]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[=($0, 'World')]) + LogicalProject(dimZipf=[$1], dim3_unnest1=[$2], EXPR$0=[$3], dimMultivalEnumerated0=[$0]) + LogicalFilter(condition=[OR(=($2, 'Baz'), =($3, 'Hello'))]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + LogicalProject(dimMultivalEnumerated=[$2], dimZipf=[$8]) + LogicalFilter(condition=[=(CAST($8):INTEGER, 27)]) + LogicalTableScan(table=[[druid, lotsocolumns]]) + +!logicalPlan +DruidProject(dimZipf=[$0], dim3_unnest1=[$1], dim3_unnest2=[$2], dim3_unnest3=[$4], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[=($0, 'World')]) + DruidProject(dimZipf=[$1], dim3_unnest1=[$2], EXPR$0=[$3], dimMultivalEnumerated0=[$0], druid=[logical]) + DruidFilter(condition=[OR(=($2, 'Baz'), =($3, 'Hello'))]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + DruidProject(dimMultivalEnumerated=[$2], dimZipf=[$8], druid=[logical]) + DruidFilter(condition=[=(CAST($8):INTEGER, 27)]) + DruidTableScan(table=[[druid, lotsocolumns]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "filter", + "base" : { + "type" : "unnest", + "base" : { + "type" : "unnest", + "base" : { + "type" : "filter", + "base" : { + "type" : "table", + "name" : "lotsocolumns" + }, + "filter" : { + "type" : "equals", + "column" : "dimZipf", + "matchValueType" : "LONG", + "matchValue" : 27 + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "mv_to_array(\"dimMultivalEnumerated\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : null + }, + "virtualColumn" : { + "type" : "expression", + "name" : "_j0.unnest", + "expression" : "mv_to_array(\"dimMultivalEnumerated\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : null + }, + "filter" : { + "type" : "or", + "fields" : [ { + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "Baz" + }, { + "type" : "equals", + "column" : "_j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "Hello" + } ] + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "__j0.unnest", + "expression" : "mv_to_array(\"dimMultivalEnumerated\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "__j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "World" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "resultFormat" : "compactedList", + "columns" : [ "dimZipf", "j0.unnest", "_j0.unnest", "__j0.unnest" ], + "columnTypes" : [ "STRING", "STRING", "STRING", "STRING" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq new file mode 100644 index 000000000000..e4da1c5d5e58 --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq @@ -0,0 +1,77 @@ +# testUnnestWithGroupByHavingSelector case-crc:76a4f833 +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// +SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) GROUP BY d3 HAVING d3='b'; ++----+--------+ +| d3 | EXPR$1 | ++----+--------+ +| b | 2 | ++----+--------+ +(1 row) + +!ok +LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) + LogicalProject(EXPR$0=[$2]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'b')]) + LogicalProject(__time=[$0], dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) + +!logicalPlan +DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) + DruidProject(EXPR$0=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'b')]) + DruidProject(__time=[$0], dim3=[$3], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + +!druidPlan +{ + "queryType" : "groupBy", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "table", + "name" : "numfoo" + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "mv_to_array(\"dim3\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "b" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "granularity" : { + "type" : "all" + }, + "dimensions" : [ { + "type" : "default", + "dimension" : "j0.unnest", + "outputName" : "d0", + "outputType" : "STRING" + } ], + "aggregations" : [ { + "type" : "count", + "name" : "a0" + } ], + "limitSpec" : { + "type" : "NoopLimitSpec" + } +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=sql.iq new file mode 100644 index 000000000000..c69694e0001e --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=sql.iq @@ -0,0 +1,75 @@ +# testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=sql case-crc:33b6333c +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// +SELECT uln, COUNT(*) FROM druid.arrays, UNNEST(arrayLongNulls) AS unnested(uln) WHERE uln IN (1, 2, 3) GROUP BY uln HAVING uln=1; ++-----+--------+ +| uln | EXPR$1 | ++-----+--------+ +| 1 | 5 | ++-----+--------+ +(1 row) + +!ok +LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) + LogicalUnnest(unnestExpr=[$0], filter=[=($0, 1)]) + LogicalProject(arrayLongNulls=[$4]) + LogicalTableScan(table=[[druid, arrays]]) + +!logicalPlan +DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) + DruidUnnest(unnestExpr=[$0], filter=[=($0, 1)]) + DruidProject(arrayLongNulls=[$4], druid=[logical]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) + +!druidPlan +{ + "queryType" : "groupBy", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "table", + "name" : "arrays" + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "\"arrayLongNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "LONG", + "matchValue" : 1 + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "granularity" : { + "type" : "all" + }, + "dimensions" : [ { + "type" : "default", + "dimension" : "j0.unnest", + "outputName" : "d0", + "outputType" : "LONG" + } ], + "aggregations" : [ { + "type" : "count", + "name" : "a0" + } ], + "limitSpec" : { + "type" : "NoopLimitSpec" + } +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq new file mode 100644 index 000000000000..c2ae75aacc1f --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq @@ -0,0 +1,77 @@ +# testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql case-crc:a97b58b2 +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// +SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) WHERE d3 IN ('a','c') GROUP BY d3 HAVING d3='a'; ++----+--------+ +| d3 | EXPR$1 | ++----+--------+ +| a | 1 | ++----+--------+ +(1 row) + +!ok +LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) + LogicalProject(EXPR$0=[$2]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'a')]) + LogicalProject(__time=[$0], dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) + +!logicalPlan +DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) + DruidProject(EXPR$0=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'a')]) + DruidProject(__time=[$0], dim3=[$3], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + +!druidPlan +{ + "queryType" : "groupBy", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "table", + "name" : "numfoo" + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "mv_to_array(\"dim3\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "a" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "granularity" : { + "type" : "all" + }, + "dimensions" : [ { + "type" : "default", + "dimension" : "j0.unnest", + "outputName" : "d0", + "outputType" : "STRING" + } ], + "aggregations" : [ { + "type" : "count", + "name" : "a0" + } ], + "limitSpec" : { + "type" : "NoopLimitSpec" + } +} +!nativePlan From dcdd7d4a9218957a3e5fcb92185ea92be0070e85 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 11:44:17 +0000 Subject: [PATCH 34/99] fix final test --- .../apache/druid/sql/calcite/CalciteArraysQueryTest.java | 7 ++++--- .../org/apache/druid/sql/calcite/DecoupledTestConfig.java | 6 +++++- .../java/org/apache/druid/sql/calcite/NotYetSupported.java | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 756b070ff247..76207da341b9 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4597,8 +4597,8 @@ public void testUnnestTwiceWithFiltersAndExpressions() ); } - - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) + @NotYetSupported(Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) + @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) @Test public void testUnnestThriceWithFiltersOnDimAndUnnestCol() { @@ -4685,7 +4685,8 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestCol() ); } - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) + @NotYetSupported(Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) + @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumns() { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java index ba46dea8008b..98a0a54c8224 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java @@ -53,7 +53,11 @@ enum IgnoreQueriesReason /** * An extra ScanQuery to service a Project and/or Filter was added. */ - UNNEST_EXTRA_SCANQUERY; + UNNEST_EXTRA_SCANQUERY, + /** + * Occurs in tandem with {@link NotYetSupported.Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS}. + */ + RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS; public boolean isPresent() { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java b/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java index f456bae91f78..fda2a58c80e0 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java @@ -95,7 +95,8 @@ enum Modes REQUIRE_TIME_CONDITION(CannotBuildQueryException.class, "requireTimeCondition is enabled"), ERROR_CANNOT_TRANSLATE_COUNT_DISTINCT(AssertionError.class, "Cannot translate aggregator.COUNT.DISTINCT"), UNNEST_INLINED(Exception.class, "Missing conversion is Uncollect"), - UNNEST_RESULT_MISMATCH(AssertionError.class, "(Result count mismatch|column content mismatch)"); + UNNEST_RESULT_MISMATCH(AssertionError.class, "(Result count mismatch|column content mismatch)"), + RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS(AssertionError.class, "(Result count mismatch|column content mismatch)"); // @formatter:on public Class throwableClass; From 23e4dab3dfc03a53caacec220ca1e91d1c96b5f7 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 11:50:17 +0000 Subject: [PATCH 35/99] trim-trim --- ...LookupTableMismatchedTypes@all_disabled.iq | 69 +++++++------------ ...eLookupTableMismatchedTypes@all_enabled.iq | 69 +++++++------------ ...TableLookupTableMismatchedTypes@default.iq | 69 +++++++------------ ...edTypes@filter-on-value-column_disabled.iq | 69 +++++++------------ ...ismatchedTypes@filter-rewrites-disabled.iq | 69 +++++++------------ ...kupTableMismatchedTypes@filter-rewrites.iq | 69 +++++++------------ ...okupTableMismatchedTypes@join-to-filter.iq | 69 +++++++------------ ...pNOnInnerJoinWithLimit@NullHandling=sql.iq | 14 ++-- ...taSources@all_disabled@NullHandling=sql.iq | 14 ++-- ...ataSources@all_enabled@NullHandling=sql.iq | 14 ++-- ...ineDataSources@default@NullHandling=sql.iq | 14 ++-- ...-value-column_disabled@NullHandling=sql.iq | 14 ++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 ++-- ...ources@filter-rewrites@NullHandling=sql.iq | 14 ++-- ...Sources@join-to-filter@NullHandling=sql.iq | 14 ++-- ...ectAccess@all_disabled@NullHandling=sql.iq | 14 ++-- ...rectAccess@all_enabled@NullHandling=sql.iq | 14 ++-- ...ftDirectAccess@default@NullHandling=sql.iq | 14 ++-- ...-value-column_disabled@NullHandling=sql.iq | 14 ++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 ++-- ...Access@filter-rewrites@NullHandling=sql.iq | 14 ++-- ...tAccess@join-to-filter@NullHandling=sql.iq | 14 ++-- ...ectAccess@all_disabled@NullHandling=sql.iq | 14 ++-- ...rectAccess@all_enabled@NullHandling=sql.iq | 14 ++-- ...ftDirectAccess@default@NullHandling=sql.iq | 14 ++-- ...-value-column_disabled@NullHandling=sql.iq | 14 ++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 ++-- ...Access@filter-rewrites@NullHandling=sql.iq | 14 ++-- ...tAccess@join-to-filter@NullHandling=sql.iq | 14 ++-- ...tyResults@all_disabled@NullHandling=sql.iq | 26 ++++--- ...ptyResults@all_enabled@NullHandling=sql.iq | 26 ++++--- ...rsEmptyResults@default@NullHandling=sql.iq | 26 ++++--- ...-value-column_disabled@NullHandling=sql.iq | 26 ++++--- ...lter-rewrites-disabled@NullHandling=sql.iq | 26 ++++--- ...esults@filter-rewrites@NullHandling=sql.iq | 26 ++++--- ...Results@join-to-filter@NullHandling=sql.iq | 26 ++++--- ...tyResults@all_disabled@NullHandling=sql.iq | 26 ++++--- ...ptyResults@all_enabled@NullHandling=sql.iq | 26 ++++--- ...onEmptyResults@default@NullHandling=sql.iq | 26 ++++--- ...-value-column_disabled@NullHandling=sql.iq | 26 ++++--- ...lter-rewrites-disabled@NullHandling=sql.iq | 26 ++++--- ...esults@filter-rewrites@NullHandling=sql.iq | 26 ++++--- ...Results@join-to-filter@NullHandling=sql.iq | 26 ++++--- ...ullFilter@all_disabled@NullHandling=sql.iq | 20 +++--- ...NullFilter@all_enabled@NullHandling=sql.iq | 20 +++--- ...thIsNullFilter@default@NullHandling=sql.iq | 20 +++--- ...-value-column_disabled@NullHandling=sql.iq | 20 +++--- ...lter-rewrites-disabled@NullHandling=sql.iq | 20 +++--- ...Filter@filter-rewrites@NullHandling=sql.iq | 20 +++--- ...lFilter@join-to-filter@NullHandling=sql.iq | 20 +++--- ...eseriesWithFloorOnTime@NullHandling=sql.iq | 14 ++-- ...ggregateMultipleValues@NullHandling=sql.iq | 14 ++-- ...eseriesWithFloorOnTime@NullHandling=sql.iq | 14 ++-- ...nWithInputRefCondition@NullHandling=sql.iq | 16 ++--- ...ectAccess@all_disabled@NullHandling=sql.iq | 14 ++-- ...rectAccess@all_enabled@NullHandling=sql.iq | 14 ++-- ...ftDirectAccess@default@NullHandling=sql.iq | 14 ++-- ...-value-column_disabled@NullHandling=sql.iq | 14 ++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 ++-- ...Access@filter-rewrites@NullHandling=sql.iq | 14 ++-- ...tAccess@join-to-filter@NullHandling=sql.iq | 14 ++-- ...ectAccess@all_disabled@NullHandling=sql.iq | 12 ++-- ...rectAccess@all_enabled@NullHandling=sql.iq | 12 ++-- ...ftDirectAccess@default@NullHandling=sql.iq | 12 ++-- ...-value-column_disabled@NullHandling=sql.iq | 12 ++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 12 ++-- ...Access@filter-rewrites@NullHandling=sql.iq | 12 ++-- ...tAccess@join-to-filter@NullHandling=sql.iq | 12 ++-- ...ectAccess@all_disabled@NullHandling=sql.iq | 14 ++-- ...rectAccess@all_enabled@NullHandling=sql.iq | 14 ++-- ...ftDirectAccess@default@NullHandling=sql.iq | 14 ++-- ...-value-column_disabled@NullHandling=sql.iq | 14 ++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 ++-- ...Access@filter-rewrites@NullHandling=sql.iq | 14 ++-- ...tAccess@join-to-filter@NullHandling=sql.iq | 14 ++-- ...ithFilter@all_disabled@NullHandling=sql.iq | 20 +++--- ...WithFilter@all_enabled@NullHandling=sql.iq | 20 +++--- ...urceWithFilter@default@NullHandling=sql.iq | 20 +++--- ...-value-column_disabled@NullHandling=sql.iq | 20 +++--- ...lter-rewrites-disabled@NullHandling=sql.iq | 20 +++--- ...Filter@filter-rewrites@NullHandling=sql.iq | 20 +++--- ...hFilter@join-to-filter@NullHandling=sql.iq | 20 +++--- ...icitJoins@all_disabled@NullHandling=sql.iq | 20 +++--- ...licitJoins@all_enabled@NullHandling=sql.iq | 20 +++--- ...gExplicitJoins@default@NullHandling=sql.iq | 20 +++--- ...-value-column_disabled@NullHandling=sql.iq | 20 +++--- ...lter-rewrites-disabled@NullHandling=sql.iq | 20 +++--- ...tJoins@filter-rewrites@NullHandling=sql.iq | 20 +++--- ...itJoins@join-to-filter@NullHandling=sql.iq | 20 +++--- ...nSubquery@all_disabled@NullHandling=sql.iq | 26 +++---- ...InSubquery@all_enabled@NullHandling=sql.iq | 26 +++---- ...hereInSubquery@default@NullHandling=sql.iq | 26 +++---- ...-value-column_disabled@NullHandling=sql.iq | 26 +++---- ...lter-rewrites-disabled@NullHandling=sql.iq | 26 +++---- ...bquery@filter-rewrites@NullHandling=sql.iq | 26 +++---- ...ubquery@join-to-filter@NullHandling=sql.iq | 26 +++---- ...ctAggregateWithOrderBy@NullHandling=sql.iq | 22 +++--- ...thOuterTimeExtractScan@NullHandling=sql.iq | 22 +++--- ...taneously@all_disabled@NullHandling=sql.iq | 28 ++++---- ...ltaneously@all_enabled@NullHandling=sql.iq | 28 ++++---- ...Simultaneously@default@NullHandling=sql.iq | 28 ++++---- ...-value-column_disabled@NullHandling=sql.iq | 28 ++++---- ...lter-rewrites-disabled@NullHandling=sql.iq | 28 ++++---- ...eously@filter-rewrites@NullHandling=sql.iq | 28 ++++---- ...neously@join-to-filter@NullHandling=sql.iq | 28 ++++---- ...lTwoQueriesLeftQueryIsJoin@all_disabled.iq | 10 ++- ...llTwoQueriesLeftQueryIsJoin@all_enabled.iq | 10 ++- ...ionAllTwoQueriesLeftQueryIsJoin@default.iq | 10 ++- ...yIsJoin@filter-on-value-column_disabled.iq | 10 ++- ...eftQueryIsJoin@filter-rewrites-disabled.iq | 10 ++- ...oQueriesLeftQueryIsJoin@filter-rewrites.iq | 10 ++- ...woQueriesLeftQueryIsJoin@join-to-filter.iq | 10 ++- ...TwoQueriesRightQueryIsJoin@all_disabled.iq | 10 ++- ...lTwoQueriesRightQueryIsJoin@all_enabled.iq | 10 ++- ...onAllTwoQueriesRightQueryIsJoin@default.iq | 10 ++- ...yIsJoin@filter-on-value-column_disabled.iq | 10 ++- ...ghtQueryIsJoin@filter-rewrites-disabled.iq | 10 ++- ...QueriesRightQueryIsJoin@filter-rewrites.iq | 10 ++- ...oQueriesRightQueryIsJoin@join-to-filter.iq | 10 ++- ...AndFilter@all_disabled@NullHandling=sql.iq | 22 +++--- ...fAndFilter@all_enabled@NullHandling=sql.iq | 22 +++--- ...artOfAndFilter@default@NullHandling=sql.iq | 22 +++--- ...-value-column_disabled@NullHandling=sql.iq | 22 +++--- ...lter-rewrites-disabled@NullHandling=sql.iq | 22 +++--- ...Filter@filter-rewrites@NullHandling=sql.iq | 22 +++--- ...dFilter@join-to-filter@NullHandling=sql.iq | 22 +++--- ...actionFns@all_disabled@NullHandling=sql.iq | 14 ++-- ...ractionFns@all_enabled@NullHandling=sql.iq | 14 ++-- ...hExtractionFns@default@NullHandling=sql.iq | 14 ++-- ...-value-column_disabled@NullHandling=sql.iq | 14 ++-- ...lter-rewrites-disabled@NullHandling=sql.iq | 14 ++-- ...ionFns@filter-rewrites@NullHandling=sql.iq | 14 ++-- ...tionFns@join-to-filter@NullHandling=sql.iq | 14 ++-- 133 files changed, 1142 insertions(+), 1585 deletions(-) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@all_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@all_disabled.iq index 89f9a54998d0..32be71344976 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@all_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@all_disabled.iq @@ -24,9 +24,9 @@ WHERE foo.cnt = l.k AND l.k = numfoo.cnt !ok LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) - LogicalProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(k0=[CAST($1):BIGINT]) + LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) LogicalJoin(condition=[true], joinType=[inner]) LogicalProject(cnt=[$4]) LogicalTableScan(table=[[druid, foo]]) @@ -37,9 +37,9 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[=($0, CAST($1):BIGINT)]) - DruidProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(k0=[CAST($1):BIGINT], druid=[logical]) + DruidFilter(condition=[=($0, CAST($1):BIGINT)]) DruidJoin(condition=[true], joinType=[inner]) DruidProject(cnt=[$4], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) @@ -58,53 +58,36 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "query" : { "queryType" : "scan", "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"j0.k\", 'LONG')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "join", + "left" : { + "type" : "table", + "name" : "foo" + }, + "right" : { + "type" : "lookup", + "lookup" : "lookyloo" + }, + "rightPrefix" : "j0.", + "condition" : "1", + "joinType" : "INNER" }, "intervals" : { "type" : "intervals", "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "CAST(\"j0.k\", 'LONG')", + "outputType" : "LONG" + } ], "resultFormat" : "compactedList", "filter" : { "type" : "expression", "expression" : "(\"cnt\" == CAST(\"j0.k\", 'LONG'))" }, - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0" ], + "columnTypes" : [ "LONG" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@all_enabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@all_enabled.iq index 94b7f73e1313..f9dbf416b365 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@all_enabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@all_enabled.iq @@ -24,9 +24,9 @@ WHERE foo.cnt = l.k AND l.k = numfoo.cnt !ok LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) - LogicalProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(k0=[CAST($1):BIGINT]) + LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) LogicalJoin(condition=[true], joinType=[inner]) LogicalProject(cnt=[$4]) LogicalTableScan(table=[[druid, foo]]) @@ -37,9 +37,9 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[=($0, CAST($1):BIGINT)]) - DruidProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(k0=[CAST($1):BIGINT], druid=[logical]) + DruidFilter(condition=[=($0, CAST($1):BIGINT)]) DruidJoin(condition=[true], joinType=[inner]) DruidProject(cnt=[$4], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) @@ -58,53 +58,36 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "query" : { "queryType" : "scan", "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"j0.k\", 'LONG')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "join", + "left" : { + "type" : "table", + "name" : "foo" + }, + "right" : { + "type" : "lookup", + "lookup" : "lookyloo" + }, + "rightPrefix" : "j0.", + "condition" : "1", + "joinType" : "INNER" }, "intervals" : { "type" : "intervals", "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "CAST(\"j0.k\", 'LONG')", + "outputType" : "LONG" + } ], "resultFormat" : "compactedList", "filter" : { "type" : "expression", "expression" : "(\"cnt\" == CAST(\"j0.k\", 'LONG'))" }, - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0" ], + "columnTypes" : [ "LONG" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@default.iq index d633b774a5f1..38aa6b4db531 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@default.iq @@ -21,9 +21,9 @@ WHERE foo.cnt = l.k AND l.k = numfoo.cnt !ok LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) - LogicalProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(k0=[CAST($1):BIGINT]) + LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) LogicalJoin(condition=[true], joinType=[inner]) LogicalProject(cnt=[$4]) LogicalTableScan(table=[[druid, foo]]) @@ -34,9 +34,9 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[=($0, CAST($1):BIGINT)]) - DruidProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(k0=[CAST($1):BIGINT], druid=[logical]) + DruidFilter(condition=[=($0, CAST($1):BIGINT)]) DruidJoin(condition=[true], joinType=[inner]) DruidProject(cnt=[$4], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) @@ -55,53 +55,36 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "query" : { "queryType" : "scan", "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"j0.k\", 'LONG')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "join", + "left" : { + "type" : "table", + "name" : "foo" + }, + "right" : { + "type" : "lookup", + "lookup" : "lookyloo" + }, + "rightPrefix" : "j0.", + "condition" : "1", + "joinType" : "INNER" }, "intervals" : { "type" : "intervals", "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "CAST(\"j0.k\", 'LONG')", + "outputType" : "LONG" + } ], "resultFormat" : "compactedList", "filter" : { "type" : "expression", "expression" : "(\"cnt\" == CAST(\"j0.k\", 'LONG'))" }, - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0" ], + "columnTypes" : [ "LONG" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-on-value-column_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-on-value-column_disabled.iq index b35cc7db31ba..645631000d53 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-on-value-column_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-on-value-column_disabled.iq @@ -24,9 +24,9 @@ WHERE foo.cnt = l.k AND l.k = numfoo.cnt !ok LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) - LogicalProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(k0=[CAST($1):BIGINT]) + LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) LogicalJoin(condition=[true], joinType=[inner]) LogicalProject(cnt=[$4]) LogicalTableScan(table=[[druid, foo]]) @@ -37,9 +37,9 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[=($0, CAST($1):BIGINT)]) - DruidProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(k0=[CAST($1):BIGINT], druid=[logical]) + DruidFilter(condition=[=($0, CAST($1):BIGINT)]) DruidJoin(condition=[true], joinType=[inner]) DruidProject(cnt=[$4], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) @@ -58,53 +58,36 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "query" : { "queryType" : "scan", "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"j0.k\", 'LONG')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "join", + "left" : { + "type" : "table", + "name" : "foo" + }, + "right" : { + "type" : "lookup", + "lookup" : "lookyloo" + }, + "rightPrefix" : "j0.", + "condition" : "1", + "joinType" : "INNER" }, "intervals" : { "type" : "intervals", "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "CAST(\"j0.k\", 'LONG')", + "outputType" : "LONG" + } ], "resultFormat" : "compactedList", "filter" : { "type" : "expression", "expression" : "(\"cnt\" == CAST(\"j0.k\", 'LONG'))" }, - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0" ], + "columnTypes" : [ "LONG" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-rewrites-disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-rewrites-disabled.iq index c8a0f41b1dca..edfc721749a8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-rewrites-disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-rewrites-disabled.iq @@ -24,9 +24,9 @@ WHERE foo.cnt = l.k AND l.k = numfoo.cnt !ok LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) - LogicalProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(k0=[CAST($1):BIGINT]) + LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) LogicalJoin(condition=[true], joinType=[inner]) LogicalProject(cnt=[$4]) LogicalTableScan(table=[[druid, foo]]) @@ -37,9 +37,9 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[=($0, CAST($1):BIGINT)]) - DruidProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(k0=[CAST($1):BIGINT], druid=[logical]) + DruidFilter(condition=[=($0, CAST($1):BIGINT)]) DruidJoin(condition=[true], joinType=[inner]) DruidProject(cnt=[$4], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) @@ -58,53 +58,36 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "query" : { "queryType" : "scan", "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"j0.k\", 'LONG')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "join", + "left" : { + "type" : "table", + "name" : "foo" + }, + "right" : { + "type" : "lookup", + "lookup" : "lookyloo" + }, + "rightPrefix" : "j0.", + "condition" : "1", + "joinType" : "INNER" }, "intervals" : { "type" : "intervals", "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "CAST(\"j0.k\", 'LONG')", + "outputType" : "LONG" + } ], "resultFormat" : "compactedList", "filter" : { "type" : "expression", "expression" : "(\"cnt\" == CAST(\"j0.k\", 'LONG'))" }, - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0" ], + "columnTypes" : [ "LONG" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-rewrites.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-rewrites.iq index 7dbdb9d245cd..5163ff4a8e2d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-rewrites.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@filter-rewrites.iq @@ -24,9 +24,9 @@ WHERE foo.cnt = l.k AND l.k = numfoo.cnt !ok LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) - LogicalProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(k0=[CAST($1):BIGINT]) + LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) LogicalJoin(condition=[true], joinType=[inner]) LogicalProject(cnt=[$4]) LogicalTableScan(table=[[druid, foo]]) @@ -37,9 +37,9 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[=($0, CAST($1):BIGINT)]) - DruidProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(k0=[CAST($1):BIGINT], druid=[logical]) + DruidFilter(condition=[=($0, CAST($1):BIGINT)]) DruidJoin(condition=[true], joinType=[inner]) DruidProject(cnt=[$4], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) @@ -58,53 +58,36 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "query" : { "queryType" : "scan", "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"j0.k\", 'LONG')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "join", + "left" : { + "type" : "table", + "name" : "foo" + }, + "right" : { + "type" : "lookup", + "lookup" : "lookyloo" + }, + "rightPrefix" : "j0.", + "condition" : "1", + "joinType" : "INNER" }, "intervals" : { "type" : "intervals", "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "CAST(\"j0.k\", 'LONG')", + "outputType" : "LONG" + } ], "resultFormat" : "compactedList", "filter" : { "type" : "expression", "expression" : "(\"cnt\" == CAST(\"j0.k\", 'LONG'))" }, - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0" ], + "columnTypes" : [ "LONG" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@join-to-filter.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@join-to-filter.iq index 4f3f7571a22b..a35a6538e659 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@join-to-filter.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testCommaJoinTableLookupTableMismatchedTypes@join-to-filter.iq @@ -24,9 +24,9 @@ WHERE foo.cnt = l.k AND l.k = numfoo.cnt !ok LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) - LogicalProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(k0=[CAST($1):BIGINT]) + LogicalFilter(condition=[=($0, CAST($1):BIGINT)]) LogicalJoin(condition=[true], joinType=[inner]) LogicalProject(cnt=[$4]) LogicalTableScan(table=[[druid, foo]]) @@ -37,9 +37,9 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[=($0, CAST($1):BIGINT)]) - DruidProject(cnt=[$0], k=[$1], k0=[CAST($1):BIGINT], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(k0=[CAST($1):BIGINT], druid=[logical]) + DruidFilter(condition=[=($0, CAST($1):BIGINT)]) DruidJoin(condition=[true], joinType=[inner]) DruidProject(cnt=[$4], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) @@ -58,53 +58,36 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) "query" : { "queryType" : "scan", "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"j0.k\", 'LONG')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "join", + "left" : { + "type" : "table", + "name" : "foo" + }, + "right" : { + "type" : "lookup", + "lookup" : "lookyloo" + }, + "rightPrefix" : "j0.", + "condition" : "1", + "joinType" : "INNER" }, "intervals" : { "type" : "intervals", "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "CAST(\"j0.k\", 'LONG')", + "outputType" : "LONG" + } ], "resultFormat" : "compactedList", "filter" : { "type" : "expression", "expression" : "(\"cnt\" == CAST(\"j0.k\", 'LONG'))" }, - "columns" : [ "cnt", "j0.k", "v0" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0" ], + "columnTypes" : [ "LONG" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq index 4801431c81fc..89919ef819ae 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=sql.iq @@ -25,10 +25,9 @@ LogicalSort(fetch=[1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim4=[$4], m1=[$14]) LogicalTableScan(table=[[druid, numfoo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, 'a')]) - LogicalProject(dim4=[$4]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalAggregate(group=[{4}]) + LogicalFilter(condition=[<>($4, 'a')]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidSort(fetch=[1], druid=[logical]) @@ -36,10 +35,9 @@ DruidSort(fetch=[1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim4=[$4], m1=[$14], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, 'a')]) - DruidProject(dim4=[$4], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidAggregate(group=[{4}], druid=[logical]) + DruidFilter(condition=[<>($4, 'a')]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq index 8a0ce77fc8f4..52087ed62765 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=sql.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq index 0e3e294f1adf..33556cd485fa 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=sql.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq index 84739e3d0ee5..09785d5c178c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=sql.iq @@ -28,10 +28,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq index 7e207f136230..8ce84d69e397 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=sql.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq index 3190ce1fe96c..82d7dcdee5c0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=sql.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq index 013f77c38d8d..eb38a3c33f01 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=sql.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq index 3588a764d2c2..5ae0e78c10c8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=sql.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq index 5b0c94c3c163..e553be29d9f1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq index 3575927cff4d..fa054c162254 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq index 7a037d8bb8c1..9f04823844c1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq @@ -27,10 +27,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -38,10 +37,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq index 424482d85e1f..8ab934aa38b5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq index f9b22aa51eb8..68861b993c76 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq index 75540d74b713..3b35adf2a126 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq index 02f5bafb7881..154056ddf061 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq index 4de014680045..bd2b636c01d4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq index 4b15b4865294..246e608caa57 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq index 25d93d5f2e42..c8506ace31dc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq @@ -27,10 +27,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -38,10 +37,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq index 72b983da6138..fced12990b83 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq index 05a2df80a875..610260e4e65d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq index 38555c87dedf..9ebbc7e18d35 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq index d3e089ddcaf4..50484dab8b94 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=sql.iq index a67633991e41..aba742c64086 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=sql.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -257,8 +255,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=sql.iq index 362c59a2d5f1..1cf7c88fff91 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=sql.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -257,8 +255,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=sql.iq index b9f8ae2b6cfc..a488b4dc9530 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=sql.iq @@ -20,22 +20,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -254,8 +252,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq index 94fe9ca1953c..27e068eb4696 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -257,8 +255,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq index d3ac1b35a610..2034baf38ffb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -257,8 +255,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=sql.iq index 32543d4b310a..d5b72adf3bdd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=sql.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -257,8 +255,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=sql.iq index a90c49a5c08c..3497e7aa2dd6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=sql.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -257,8 +255,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=sql.iq index 97cebac6335f..21d396346c3c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=sql.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -258,8 +256,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=sql.iq index 8dece7f89ea9..eb79c0f531e5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=sql.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -258,8 +256,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=sql.iq index d927029ea2c8..86e280988f3d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=sql.iq @@ -21,22 +21,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -255,8 +253,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq index 02455d8a2787..0e9975c8fc6a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=sql.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -258,8 +256,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq index aec779732b7a..df30457a2044 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=sql.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -258,8 +256,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=sql.iq index 3d5da0011b20..9f5c8144d426 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=sql.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -258,8 +256,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=sql.iq index 7d01bbbc1639..58eb0f1358dd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=sql.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -258,8 +256,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=sql.iq index 5494c70717d5..7bc5d8d4c5a6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=sql.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -57,8 +57,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "type" : "null", "column" : "dim2" }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=sql.iq index 71ff3c513153..cf2f4ba020ba 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=sql.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -57,8 +57,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "type" : "null", "column" : "dim2" }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=sql.iq index ac808026cd40..45a8c0e86436 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=sql.iq @@ -17,18 +17,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -54,8 +54,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "type" : "null", "column" : "dim2" }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=sql.iq index de1730371b66..cc2df3c3bbd6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=sql.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -57,8 +57,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "type" : "null", "column" : "dim2" }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=sql.iq index 5258e3f9c9a8..f14b72b728fb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=sql.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -57,8 +57,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "type" : "null", "column" : "dim2" }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=sql.iq index 0cd43017a00b..af042b3e3915 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=sql.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -57,8 +57,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "type" : "null", "column" : "dim2" }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=sql.iq index 07a954368eff..acbfd7673983 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=sql.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -57,8 +57,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "type" : "null", "column" : "dim2" }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq index c75b0f7b627a..07124f8cac04 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2]) - LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5]) + LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)], druid=[logical]) @@ -42,10 +41,9 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2], druid=[logical]) - DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical]) + DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq index 9774f3a55958..2a03f6e25160 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2]) - LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5]) + LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) @@ -42,10 +41,9 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2], druid=[logical]) - DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical]) + DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq index 129f7ab4e406..077841f3fe90 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$2]) - LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5]) + LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) @@ -42,10 +41,9 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$2], druid=[logical]) - DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5], druid=[logical]) + DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq index 0e602d6d0867..4ba876fd1c15 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq @@ -22,12 +22,10 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0]) LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $10)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], i=[LITERAL_AGG(true)]) - LogicalProject(m1=[$5]) + LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($5)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{5}], i=[LITERAL_AGG(true)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) @@ -35,12 +33,10 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $10)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], i=[LITERAL_AGG(true)], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) + DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($5)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{5}], i=[LITERAL_AGG(true)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq index 16f93880854b..93293e3f7e80 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq index 272949a3ebf6..90f37d025af6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq index e5e92ef81856..ab43f9604a69 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=sql.iq @@ -27,10 +27,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -38,10 +37,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq index 5cf96c85a7f7..0d4e75093b95 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq index 41682ec2cde9..602e70825959 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq index 46d755904b30..e719d27e6dff 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq index bb823ec44288..c74c2744c540 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq index 1f79d1249793..5682326c03e0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=sql.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq index 9be48cb39953..098f6a50bc90 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=sql.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq index 3686ceb105e4..a27da638639d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=sql.iq @@ -27,24 +27,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq index 93a5853c01ad..295802c72308 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq index fed4c5113ac0..8815732fe58c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq index 70e0fa0dac7e..d5e5d614e3dc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq index e45f471d7aa1..0a1b6a66606f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq index dcf896c46a68..7dbc2ff6923d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq index e847a4a09231..e4c05ae03b3c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq index 66a5d41ee3fb..40515f8b62d5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=sql.iq @@ -27,10 +27,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -38,10 +37,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq index 1172e3f1cdf8..54427093b152 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq index 20b7e1ee40a6..9227fb31b5e3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq index bc57a0b72f67..580ed6694725 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq index 5d1169c0beed..800a422b8f09 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=sql.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq index 3d362992c61e..b9061c82b48e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=sql.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq index 3395ad549f16..8d7159ff5b9e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=sql.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq index 9e11899f6757..7973ce094bdb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=sql.iq @@ -21,30 +21,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq index 8e2e37efb6c3..f48aaf889889 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=sql.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq index 9680b09c320f..bcf57a485d4d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=sql.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq index 5ca54c6c0479..3eb5cd8e82f3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=sql.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq index ddc0df483b2b..a5efd31c0f37 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=sql.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq index 08ae89827a16..217ea7106802 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=sql.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq index c701b95003f3..a618c200a062 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=sql.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq index d82aeb2ff825..291b1d7504b2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=sql.iq @@ -27,30 +27,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq index f880ad5b4a28..6215304016c2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq index 9fe9ec5deafc..b2fe0199d161 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq index 623094f55027..fd547ad48fd7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=sql.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq index 1f63827dc90e..45c81376e159 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=sql.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq index a9e022e7604b..b96110f2e43d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=sql.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq index 0ec49584d16e..708d508f3ec3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=sql.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq index ae4653b2be6b..6bc63a4b6727 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=sql.iq @@ -27,20 +27,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -48,20 +45,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq index 14989b9a9599..e9a9e8650860 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=sql.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq index aa827513393f..9dae52fdaa59 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=sql.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq index 8749922e20c0..a833264f4143 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=sql.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq index f250ad3bab80..2bff7a7fce5c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=sql.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq index 5cdc962836da..44e9ad52a1dd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=sql.iq @@ -28,26 +28,24 @@ LogicalProject(EXPR$0=[$1], EXPR$1=[$0]) LogicalAggregate(group=[{0}], EXPR$0=[COUNT(DISTINCT $1)]) LogicalProject(EXPR$1=[EXTRACT(FLAG(MONTH), $0)], dim1=[$1]) LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[<>($1, '')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{2}]) + LogicalFilter(condition=[=($1, 'def')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(EXPR$0=[$1], EXPR$1=[$0], druid=[logical]) DruidAggregate(group=[{0}], EXPR$0=[COUNT(DISTINCT $1)], druid=[logical]) DruidProject(EXPR$1=[EXTRACT(FLAG(MONTH), $0)], dim1=[$1], druid=[logical]) DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[<>($1, '')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{2}], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq index 4511c06a1e33..34ba0b834742 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=sql.iq @@ -24,24 +24,22 @@ SELECT dim1, EXTRACT(MONTH FROM __time) FROM druid.foo !ok LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[<>($1, '')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{2}]) + LogicalFilter(condition=[=($1, 'def')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[<>($1, '')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{2}], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq index 9d80ada42429..35ffee106dd1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=sql.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq index 5b288ec474d9..bfa788d625b1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=sql.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq index c8601dc53bb4..d975572e2e53 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=sql.iq @@ -24,33 +24,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq index e1021e77dbbd..95356998823a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=sql.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq index 763904087ce8..87163b1deee1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=sql.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq index 22a0d6f42ce2..e820adfe963c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=sql.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq index a19e12604da6..ce6559715c2e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=sql.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_disabled.iq index a48263f5c6a8..890e2d861616 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_disabled.iq @@ -28,9 +28,8 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -40,9 +39,8 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_enabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_enabled.iq index 23602dc99f08..f8fef5db5176 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_enabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@all_enabled.iq @@ -28,9 +28,8 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -40,9 +39,8 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@default.iq index 7e20f3dbd39f..c215c664567c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@default.iq @@ -25,9 +25,8 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -37,9 +36,8 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-on-value-column_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-on-value-column_disabled.iq index e07745a1a5ce..1e5ff447f876 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-on-value-column_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-on-value-column_disabled.iq @@ -28,9 +28,8 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -40,9 +39,8 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites-disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites-disabled.iq index 401229c64f02..f5ee8b38c819 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites-disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites-disabled.iq @@ -28,9 +28,8 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -40,9 +39,8 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites.iq index bf6bb07a9713..66213a432d60 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@filter-rewrites.iq @@ -28,9 +28,8 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -40,9 +39,8 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@join-to-filter.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@join-to-filter.iq index daffe515483c..01202d21211b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@join-to-filter.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesLeftQueryIsJoin@join-to-filter.iq @@ -28,9 +28,8 @@ LogicalUnion(all=[true]) LogicalTableScan(table=[[druid, foo]]) LogicalProject(k=[$0]) LogicalTableScan(table=[[lookup, lookyloo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidUnion(all=[true]) @@ -40,9 +39,8 @@ DruidUnion(all=[true]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(k=[$0], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_disabled.iq index 75d958152e3f..8000f8cc6df8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_disabled.iq @@ -22,9 +22,8 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -34,9 +33,8 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_enabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_enabled.iq index 1cf4e11db901..0093d4e581da 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_enabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@all_enabled.iq @@ -22,9 +22,8 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -34,9 +33,8 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@default.iq index ae6924289a80..791603a22fe2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@default.iq @@ -19,9 +19,8 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -31,9 +30,8 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-on-value-column_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-on-value-column_disabled.iq index 71a67ca62a98..d17665f24acb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-on-value-column_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-on-value-column_disabled.iq @@ -22,9 +22,8 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -34,9 +33,8 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites-disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites-disabled.iq index 5152ceb6471f..1199eca6b1ee 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites-disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites-disabled.iq @@ -22,9 +22,8 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -34,9 +33,8 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites.iq index d08cdd3ea622..80bba8f87d08 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@filter-rewrites.iq @@ -22,9 +22,8 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -34,9 +33,8 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@join-to-filter.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@join-to-filter.iq index 69d77a12634f..02a589ab2026 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@join-to-filter.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUnionAllTwoQueriesRightQueryIsJoin@join-to-filter.iq @@ -22,9 +22,8 @@ !ok LogicalUnion(all=[true]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) LogicalProject(dim1=[$1]) @@ -34,9 +33,8 @@ LogicalUnion(all=[true]) !logicalPlan DruidUnion(all=[true]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) DruidProject(dim1=[$1], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq index b1ea09cd1ba7..c82f4a3d0080 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=sql.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq index f7b42e15f3d3..a6da77c34f1e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=sql.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq index 559423dd4c11..aa341b309108 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=sql.iq @@ -23,25 +23,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq index be682a074983..9b2825c25d4c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=sql.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq index 60044dedc39b..ad2cb718d7a0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=sql.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq index fa0c14f0353f..970f0f757a78 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=sql.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq index 1fca19d87b55..de4f45617cc5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=sql.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq index 169bcb8c20df..cb04db285061 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=sql.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq index 5b2166114f2e..105c345ee9c0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=sql.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq index 3d29257742f2..6dffa2cc78df 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=sql.iq @@ -23,10 +23,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -34,10 +33,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq index 0a4e3f444e14..1bd6bffa1f2d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=sql.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq index e372c1efac7e..b27b5b8cb573 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=sql.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq index 82838f4462ad..c03d202cdaee 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=sql.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq index 5b8f4e646c51..40229ea1ec11 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=sql.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { From a075cb9c126b0bff302a07ad15dfa28c4b96b997 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 11:51:43 +0000 Subject: [PATCH 36/99] removal of some projects --- ...ingAndOtherAggregators@NullHandling=sql.iq | 10 +++---- ...imitPushdownExtraction@NullHandling=sql.iq | 14 ++++----- .../testGroupBySortPushDown.iq | 10 +++---- ...estGroupByWithLiteralInSubqueryGrouping.iq | 12 ++++---- ...erAggregatorsUsingJoin@NullHandling=sql.iq | 30 ++++++++----------- .../testUnionAllQueries.iq | 10 +++---- .../testUnionAllQueriesWithLimit.iq | 10 +++---- ...ndowingWithScanAndSort@NullHandling=sql.iq | 10 +++---- 8 files changed, 43 insertions(+), 63 deletions(-) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq index 3e8da105d297..636b96669464 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=sql.iq @@ -22,15 +22,13 @@ SELECT dim2, SUM(cnt), COUNT(distinct dim1) FROM druid.foo GROUP BY dim2; !ok LogicalAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{0, 1}], EXPR$1=[SUM($2)]) - LogicalProject(dim1=[$1], dim2=[$2], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1, 2}], EXPR$1=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$1=[SUM($2)], druid=[logical]) - DruidProject(dim1=[$1], dim2=[$2], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1, 2}], EXPR$1=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq index 04eab8832866..1f49a1cb53ee 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=sql.iq @@ -21,19 +21,17 @@ SELECT dim4, substring(dim5, 1, 1), count(*) FROM druid.numfoo WHERE dim4 = 'a' LogicalProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1]) LogicalSort(fetch=[2]) LogicalAggregate(group=[{0}], EXPR$2=[COUNT()]) - LogicalProject(EXPR$1=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[=($0, 'a')]) - LogicalProject(dim4=[$4], dim5=[$5]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalProject(EXPR$1=[SUBSTRING($5, 1, 1)]) + LogicalFilter(condition=[=($4, 'a')]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1], druid=[logical]) DruidSort(fetch=[2], druid=[logical]) DruidAggregate(group=[{0}], EXPR$2=[COUNT()], druid=[logical]) - DruidProject(EXPR$1=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[=($0, 'a')]) - DruidProject(dim4=[$4], dim5=[$5], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidProject(EXPR$1=[SUBSTRING($5, 1, 1)], druid=[logical]) + DruidFilter(condition=[=($4, 'a')]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupBySortPushDown.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupBySortPushDown.iq index 5cfca6d21905..ce70e1c2ba2e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupBySortPushDown.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupBySortPushDown.iq @@ -22,16 +22,14 @@ SELECT dim2, dim1, SUM(cnt) FROM druid.foo GROUP BY dim2, dim1 ORDER BY dim1 LIM !ok LogicalProject(dim2=[$1], dim1=[$0], EXPR$2=[$2]) LogicalSort(sort0=[$0], dir0=[ASC], fetch=[4]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[SUM($2)]) - LogicalProject(dim1=[$1], dim2=[$2], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1, 2}], EXPR$2=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim2=[$1], dim1=[$0], EXPR$2=[$2], druid=[logical]) DruidSort(sort0=[$0], dir0=[ASC], fetch=[4], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[SUM($2)], druid=[logical]) - DruidProject(dim1=[$1], dim2=[$2], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1, 2}], EXPR$2=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq index 8e4cb7c4b7a4..65cce7cc14b4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq @@ -30,8 +30,8 @@ SELECT +-------+----+ | t1 | t2 | +-------+----+ -| dummy | | | dummy | b | +| dummy | | +-------+----+ (2 rows) @@ -39,17 +39,15 @@ SELECT LogicalProject(t1=['dummy'], t2=[$0]) LogicalAggregate(group=[{0}]) LogicalProject(t2=[CASE(=($0, 'b'), $0, null:VARCHAR)]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim4=[$4]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalAggregate(group=[{4}]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(t1=['dummy'], t2=[$0], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(t2=[CASE(=($0, 'b'), $0, null:VARCHAR)], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim4=[$4], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidAggregate(group=[{4}], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq index c9e2aee4f6a0..315013109433 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=sql.iq @@ -24,33 +24,27 @@ SELECT dim2, COUNT(*), COUNT(distinct dim1), COUNT(distinct cnt) FROM druid.foo LogicalProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{1}], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{0, 1}]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], EXPR$3=[COUNT($1)]) - LogicalAggregate(group=[{0, 1}]) - LogicalProject(dim2=[$2], cnt=[$4]) + LogicalAggregate(group=[{1, 2}]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}], EXPR$3=[COUNT($1)]) + LogicalAggregate(group=[{2, 4}]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5], druid=[logical]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{1}], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{0, 1}], druid=[logical]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], EXPR$3=[COUNT($1)], druid=[logical]) - DruidAggregate(group=[{0, 1}], druid=[logical]) - DruidProject(dim2=[$2], cnt=[$4], druid=[logical]) + DruidAggregate(group=[{1, 2}], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], EXPR$3=[COUNT($1)], druid=[logical]) + DruidAggregate(group=[{2, 4}], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueries.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueries.iq index 553d5b692f76..e4c98567392d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueries.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueries.iq @@ -22,9 +22,8 @@ SELECT COUNT(*) FROM foo UNION ALL SELECT SUM(cnt) FROM foo UNION ALL SELECT COU LogicalUnion(all=[true]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalTableScan(table=[[druid, foo]]) @@ -32,9 +31,8 @@ LogicalUnion(all=[true]) DruidUnion(all=[true]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueriesWithLimit.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueriesWithLimit.iq index e62aa27f86df..49fa808fe731 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueriesWithLimit.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testUnionAllQueriesWithLimit.iq @@ -22,9 +22,8 @@ LogicalSort(fetch=[2]) LogicalUnion(all=[true]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[SUM($0)]) - LogicalProject(cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalTableScan(table=[[druid, foo]]) @@ -33,9 +32,8 @@ DruidSort(fetch=[2], druid=[logical]) DruidUnion(all=[true]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[SUM($0)], druid=[logical]) - DruidProject(cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq index 0891527056b9..3eb700c018fd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=sql.iq @@ -35,9 +35,8 @@ LogicalProject(ranking=[$2], trend_score=[$1]) LogicalSort(fetch=[10]) LogicalWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) LogicalProject(m2=[$1], trend_score=[$2]) - LogicalAggregate(group=[{0, 1}], trend_score=[COUNT($0)]) - LogicalProject(m1=[$5], m2=[$6]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{5, 6}], trend_score=[COUNT($5)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) @@ -45,9 +44,8 @@ DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) DruidSort(fetch=[10], druid=[logical]) DruidWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) DruidProject(m2=[$1], trend_score=[$2], druid=[logical]) - DruidAggregate(group=[{0, 1}], trend_score=[COUNT($0)], druid=[logical]) - DruidProject(m1=[$5], m2=[$6], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{5, 6}], trend_score=[COUNT($5)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { From 12373a877e19e3c87579ba86bfdf5572a79b3ccf Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 11:55:21 +0000 Subject: [PATCH 37/99] fix one --- .../org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java b/sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java index eee73d4f03e3..8ee486701a27 100644 --- a/sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java +++ b/sql/src/test/java/org/apache/druid/sql/avatica/DruidAvaticaHandlerTest.java @@ -1600,7 +1600,7 @@ public void testEscapingForGetTables() throws SQLException public void testArrayStuff() throws SQLException { try (PreparedStatement statement = client.prepareStatement( - "SELECT ARRAY_AGG(dim2) AS arr1, ARRAY_AGG(l1) AS arr2, ARRAY_AGG(d1) AS arr3, ARRAY_AGG(f1) AS arr4 FROM druid.numfoo")) { + "SELECT ARRAY_AGG(dim2) AS arr1, ARRAY_AGG(l1) AS arr2, ARRAY_AGG(dbl1) AS arr3, ARRAY_AGG(f1) AS arr4 FROM druid.numfoo")) { final ResultSet resultSet = statement.executeQuery(); final List> rows = getRows(resultSet); Assert.assertEquals(1, rows.size()); From 6ee980e8ce9bb383ddd1b1dae629cd6d69c7a097 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 11:56:48 +0000 Subject: [PATCH 38/99] update unnest.iq --- .../quidem/org.apache.druid.quidem.SqlQuidemTest/unnest.iq | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/src/test/quidem/org.apache.druid.quidem.SqlQuidemTest/unnest.iq b/sql/src/test/quidem/org.apache.druid.quidem.SqlQuidemTest/unnest.iq index aac89b7f3c7c..83158de5cb8e 100644 --- a/sql/src/test/quidem/org.apache.druid.quidem.SqlQuidemTest/unnest.iq +++ b/sql/src/test/quidem/org.apache.druid.quidem.SqlQuidemTest/unnest.iq @@ -4,9 +4,9 @@ SELECT d3 FROM (select * from druid.numfoo where dim2='a'), UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3); LogicalProject(d3=[$17]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], d3=[$18]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], d3=[$18]) LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{17}]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], $f17=[MV_TO_ARRAY($3)]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], $f17=[MV_TO_ARRAY($3)]) LogicalFilter(condition=[=($2, 'a')]) LogicalTableScan(table=[[druid, numfoo]]) LogicalProject(d3=[$0]) @@ -19,7 +19,7 @@ LogicalProject(d3=[$17]) LogicalProject(d3=[$18]) LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{17}]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], d1=[$7], d2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], $f17=[MV_TO_ARRAY($3)]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], $f17=[MV_TO_ARRAY($3)]) LogicalFilter(condition=[=($2, 'a')]) LogicalTableScan(table=[[druid, numfoo]]) Uncollect From 1e5c37b66fd7953b7722a39c36339efb3fe89b8a Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 11:57:57 +0000 Subject: [PATCH 39/99] inline const back --- .../sql/calcite/util/TestDataBuilder.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java index 63640a1deb62..383c740811e1 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java @@ -115,9 +115,6 @@ */ public class TestDataBuilder { - private static final String D1 = "dbl1"; - private static final String D2 = "dbl2"; - private static final ObjectMapper MAPPER = new DefaultObjectMapper(); public static final String TIMESTAMP_COLUMN = "t"; @@ -174,8 +171,8 @@ public Optional build( "dim5", "dim6" ))) - .add(new DoubleDimensionSchema(D1)) - .add(new DoubleDimensionSchema(D2)) + .add(new DoubleDimensionSchema("dbl1")) + .add(new DoubleDimensionSchema("dbl2")) .add(new FloatDimensionSchema("f1")) .add(new FloatDimensionSchema("f2")) .add(new LongDimensionSchema("l1")) @@ -393,7 +390,7 @@ public Optional build( .put("t", "2000-01-01") .put("m1", "1.0") .put("m2", "1.0") - .put(D1, 1.0) + .put("dbl1", 1.0) .put("f1", 1.0f) .put("l1", 7L) .put("dim1", "") @@ -407,8 +404,8 @@ public Optional build( .put("t", "2000-01-02") .put("m1", "2.0") .put("m2", "2.0") - .put(D1, 1.7) - .put(D2, 1.7) + .put("dbl1", 1.7) + .put("dbl2", 1.7) .put("f1", 0.1f) .put("f2", 0.1f) .put("l1", 325323L) @@ -424,8 +421,8 @@ public Optional build( .put("t", "2000-01-03") .put("m1", "3.0") .put("m2", "3.0") - .put(D1, 0.0) - .put(D2, 0.0) + .put("dbl1", 0.0) + .put("dbl2", 0.0) .put("f1", 0.0) .put("f2", 0.0) .put("l1", 0) @@ -597,8 +594,8 @@ public Optional build( x.get("dim3"), x.get("dim4"), x.get("dim5"), - x.get(D1), - x.get(D2), + x.get("dbl1"), + x.get("dbl2"), x.get("f1"), x.get("f2"), x.get("l1"), @@ -610,8 +607,8 @@ public Optional build( .add("dim3", ColumnType.STRING) .add("dim4", ColumnType.STRING) .add("dim5", ColumnType.STRING) - .add(D1, ColumnType.DOUBLE) - .add(D2, ColumnType.DOUBLE) + .add("dbl1", ColumnType.DOUBLE) + .add("dbl2", ColumnType.DOUBLE) .add("f1", ColumnType.FLOAT) .add("f2", ColumnType.FLOAT) .add("l1", ColumnType.LONG) From 44523a8ce31730031452471e4d265ba778291cf4 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 14 Nov 2024 17:09:08 +0000 Subject: [PATCH 40/99] update --- .../hll/sql/HllSketchSqlAggregatorTest.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchSqlAggregatorTest.java b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchSqlAggregatorTest.java index 074955625a64..795cc9b868f0 100644 --- a/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchSqlAggregatorTest.java +++ b/extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/sql/HllSketchSqlAggregatorTest.java @@ -289,7 +289,7 @@ public SpecificSegmentsQuerySegmentWalker createQuerySegmentWalker( new HllSketchBuildAggregatorFactory("hllsketch_m1", "m1", null, null, null, false, ROUND), new HllSketchBuildAggregatorFactory("hllsketch_f1", "f1", null, null, null, false, ROUND), new HllSketchBuildAggregatorFactory("hllsketch_l1", "l1", null, null, null, false, ROUND), - new HllSketchBuildAggregatorFactory("hllsketch_d1", "d1", null, null, null, false, ROUND) + new HllSketchBuildAggregatorFactory("hllsketch_dbl1", "dbl1", null, null, null, false, ROUND) ) .withRollup(false) .build() @@ -502,7 +502,7 @@ public void testApproxCountDistinctHllSketchIsRounded() GroupByQuery.builder() .setInterval(querySegmentSpec(Filtration.eternity())) .setDataSource(CalciteTests.DATASOURCE1) - .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "_d0"))) + .setDimensions(dimensions(new DefaultDimensionSpec("dim2", "d0"))) .setGranularity(Granularities.ALL) .setAggregatorSpecs( aggregators( @@ -574,7 +574,7 @@ public void testHllSketchFilteredAggregatorsGroupBy() .setInterval(new MultipleIntervalSegmentSpec(Collections.singletonList(Filtration.eternity()))) .setGranularity(Granularities.ALL) .setVirtualColumns(VirtualColumns.create(EXPECTED_PA_VIRTUAL_COLUMNS)) - .setDimensions(new DefaultDimensionSpec("cnt", "_d0", ColumnType.LONG)) + .setDimensions(new DefaultDimensionSpec("cnt", "d0", ColumnType.LONG)) .setAggregatorSpecs(EXPECTED_FILTERED_AGGREGATORS) .setPostAggregatorSpecs(EXPECTED_FILTERED_POST_AGGREGATORS) .setContext(QUERY_CONTEXT_DEFAULT) @@ -669,7 +669,7 @@ public void testHllSketchPostAggsGroupBy() .setInterval(new MultipleIntervalSegmentSpec(Collections.singletonList(Filtration.eternity()))) .setGranularity(Granularities.ALL) .setVirtualColumns(VirtualColumns.create(EXPECTED_PA_VIRTUAL_COLUMNS)) - .setDimensions(new DefaultDimensionSpec("cnt", "_d0", ColumnType.LONG)) + .setDimensions(new DefaultDimensionSpec("cnt", "d0", ColumnType.LONG)) .setAggregatorSpecs(EXPECTED_PA_AGGREGATORS) .setPostAggregatorSpecs(EXPECTED_PA_POST_AGGREGATORS) .setContext(QUERY_CONTEXT_DEFAULT) @@ -950,7 +950,7 @@ public void testGroupByAggregatorDefaultValues() .setDimFilter(equality("dim2", "a", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) - .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -1009,7 +1009,7 @@ public void testGroupByAggregatorDefaultValuesFinalizeOuterSketches() .setDimFilter(equality("dim2", "a", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) - .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -1035,7 +1035,7 @@ public void testHllEstimateAsVirtualColumn() testQuery( "SELECT" + " HLL_SKETCH_ESTIMATE(hllsketch_dim1)," - + " HLL_SKETCH_ESTIMATE(hllsketch_d1)," + + " HLL_SKETCH_ESTIMATE(hllsketch_dbl1)," + " HLL_SKETCH_ESTIMATE(hllsketch_l1)," + " HLL_SKETCH_ESTIMATE(hllsketch_f1)" + " FROM druid.foo", @@ -1045,7 +1045,7 @@ public void testHllEstimateAsVirtualColumn() .intervals(querySegmentSpec(Filtration.eternity())) .virtualColumns( makeSketchEstimateExpression("v0", "hllsketch_dim1"), - makeSketchEstimateExpression("v1", "hllsketch_d1"), + makeSketchEstimateExpression("v1", "hllsketch_dbl1"), makeSketchEstimateExpression("v2", "hllsketch_l1"), makeSketchEstimateExpression("v3", "hllsketch_f1") ) @@ -1155,7 +1155,7 @@ public void testHllEstimateAsVirtualColumnWithGroupByOrderBy() .setGranularity(Granularities.ALL) .setVirtualColumns(makeSketchEstimateExpression("v0", "hllsketch_dim1")) .setDimensions( - new DefaultDimensionSpec("v0", "_d0", ColumnType.DOUBLE)) + new DefaultDimensionSpec("v0", "d0", ColumnType.DOUBLE)) .setAggregatorSpecs( aggregators( new CountAggregatorFactory("a0") @@ -1197,7 +1197,7 @@ public void testHllEstimateAsVirtualColumnWithTopN() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) - .dimension(new DefaultDimensionSpec("v0", "_d0", ColumnType.DOUBLE)) + .dimension(new DefaultDimensionSpec("v0", "d0", ColumnType.DOUBLE)) .virtualColumns(makeSketchEstimateExpression("v0", "hllsketch_dim1")) .metric(new InvertedTopNMetricSpec(new NumericTopNMetricSpec("a0"))) .threshold(2) @@ -1266,9 +1266,9 @@ public void testResultCacheWithWindowing() /** * This is an extremely subtle test, so we explain with a comment. The `m1` column in the input data looks like - * `["1.0", "2.0", "3.0", "4.0", "5.0", "6.0"]` while the `d1` column looks like - * `[1.0, 1.7, 0.0]`. That is, "m1" is numbers-as-strings, while d1 is numbers-as-numbers. If you take the - * uniques across both columns, you expect no overlap, so 9 entries. However, if the `1.0` from `d1` gets + * `["1.0", "2.0", "3.0", "4.0", "5.0", "6.0"]` while the `dbl1` column looks like + * `[1.0, 1.7, 0.0]`. That is, "m1" is numbers-as-strings, while dbl1 is numbers-as-numbers. If you take the + * uniques across both columns, you expect no overlap, so 9 entries. However, if the `1.0` from `dbl1` gets * converted into `"1.0"` or vice-versa, the result can become 8 because then the sketch will hash the same * value multiple times considering them duplicates. This test validates that the aggregator properly builds * the sketches preserving the initial type of the data as it came in. Specifically, the test was added when @@ -1280,7 +1280,7 @@ public void testEstimateStringAndDoubleAreDifferent() { testQuery( "SELECT" - + " HLL_SKETCH_ESTIMATE(HLL_SKETCH_UNION(DS_HLL(hllsketch_d1), DS_HLL(hllsketch_m1)), true)" + + " HLL_SKETCH_ESTIMATE(HLL_SKETCH_UNION(DS_HLL(hllsketch_dbl1), DS_HLL(hllsketch_m1)), true)" + " FROM druid.foo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() @@ -1288,7 +1288,7 @@ public void testEstimateStringAndDoubleAreDifferent() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators( - new HllSketchMergeAggregatorFactory("a0", "hllsketch_d1", null, null, null, false, true), + new HllSketchMergeAggregatorFactory("a0", "hllsketch_dbl1", null, null, null, false, true), new HllSketchMergeAggregatorFactory("a1", "hllsketch_m1", null, null, null, false, true) ) .postAggregators( @@ -1320,7 +1320,7 @@ public void testEstimateStringAndDoubleAreDifferent() * This is a test in a similar vein to {@link #testEstimateStringAndDoubleAreDifferent()} except here we are * ensuring that float values and doubles values are considered equivalent. The expected initial inputs were *

- * 1. d1 -> [1.0, 1.7, 0.0] + * 1. dbl1 -> [1.0, 1.7, 0.0] * 2. f1 -> [1.0f, 0.1f, 0.0f] *

* If we assume that doubles and floats are the same, that means that there are 4 unique values, not 6 @@ -1331,7 +1331,7 @@ public void testFloatAndDoubleAreConsideredTheSame() // This is a test in a similar vein to testEstimateStringAndDoubleAreDifferent above testQuery( "SELECT" - + " HLL_SKETCH_ESTIMATE(HLL_SKETCH_UNION(DS_HLL(hllsketch_d1), DS_HLL(hllsketch_f1)), true)" + + " HLL_SKETCH_ESTIMATE(HLL_SKETCH_UNION(DS_HLL(hllsketch_dbl1), DS_HLL(hllsketch_f1)), true)" + " FROM druid.foo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() @@ -1339,7 +1339,7 @@ public void testFloatAndDoubleAreConsideredTheSame() .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .aggregators( - new HllSketchMergeAggregatorFactory("a0", "hllsketch_d1", null, null, null, false, true), + new HllSketchMergeAggregatorFactory("a0", "hllsketch_dbl1", null, null, null, false, true), new HllSketchMergeAggregatorFactory("a1", "hllsketch_f1", null, null, null, false, true) ) .postAggregators( @@ -1372,8 +1372,8 @@ public void testDsHllOnTopOfNested() // this query was not planable: https://github.com/apache/druid/issues/15353 testBuilder() .sql( - "SELECT d1,dim2,APPROX_COUNT_DISTINCT_DS_HLL(dim2, 18) as val" - + " FROM (select d1,dim1,dim2 from druid.foo group by d1,dim1,dim2 order by dim1 limit 3) t " + "SELECT dbl1,dim2,APPROX_COUNT_DISTINCT_DS_HLL(dim2, 18) as val" + + " FROM (select dbl1,dim1,dim2 from druid.foo group by dbl1,dim1,dim2 order by dim1 limit 3) t " + " group by 1,2" ) .expectedResults( From f89cc82fbbf28acede030e323f7e5af939b8542c Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 15 Nov 2024 07:58:14 +0000 Subject: [PATCH 41/99] update 2 more tests --- .../sql/BloomFilterSqlAggregatorTest.java | 72 +++++++++---------- .../sql/VarianceSqlAggregatorTest.java | 68 +++++++++--------- .../sql/calcite/DrillWindowQueryTest.java | 4 ++ 3 files changed, 74 insertions(+), 70 deletions(-) diff --git a/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/aggregation/bloom/sql/BloomFilterSqlAggregatorTest.java b/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/aggregation/bloom/sql/BloomFilterSqlAggregatorTest.java index 7de8ef8280cc..9a03012907ac 100644 --- a/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/aggregation/bloom/sql/BloomFilterSqlAggregatorTest.java +++ b/extensions-core/druid-bloom-filter/src/test/java/org/apache/druid/query/aggregation/bloom/sql/BloomFilterSqlAggregatorTest.java @@ -125,13 +125,13 @@ public void testBloomFilterAgg() throws Exception { cannotVectorize(); - BloomKFilter expected1 = new BloomKFilter(TEST_NUM_ENTRIES); + BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { String raw = NullHandling.emptyToNullIfNeeded((String) row.getRaw("dim1")); if (raw == null) { - expected1.addBytes(null, 0, 0); + expectedbl1.addBytes(null, 0, 0); } else { - expected1.addString(raw); + expectedbl1.addString(raw); } } @@ -159,8 +159,8 @@ public void testBloomFilterAgg() throws Exception ), ImmutableList.of( new Object[]{ - queryFramework().queryJsonMapper().writeValueAsString(expected1), - queryFramework().queryJsonMapper().writeValueAsString(expected1) + queryFramework().queryJsonMapper().writeValueAsString(expectedbl1), + queryFramework().queryJsonMapper().writeValueAsString(expectedbl1) } ) ); @@ -171,14 +171,14 @@ public void testBloomFilterTwoAggs() throws Exception { cannotVectorize(); - BloomKFilter expected1 = new BloomKFilter(TEST_NUM_ENTRIES); + BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); BloomKFilter expected2 = new BloomKFilter(TEST_NUM_ENTRIES); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { String raw = NullHandling.emptyToNullIfNeeded((String) row.getRaw("dim1")); if (raw == null) { - expected1.addBytes(null, 0, 0); + expectedbl1.addBytes(null, 0, 0); } else { - expected1.addString(raw); + expectedbl1.addString(raw); } List lst = row.getDimension("dim2"); if (lst.size() == 0) { @@ -223,7 +223,7 @@ public void testBloomFilterTwoAggs() throws Exception ), ImmutableList.of( new Object[] { - jsonMapper.writeValueAsString(expected1), + jsonMapper.writeValueAsString(expectedbl1), jsonMapper.writeValueAsString(expected2) } ) @@ -235,14 +235,14 @@ public void testBloomFilterAggExtractionFn() throws Exception { cannotVectorize(); - BloomKFilter expected1 = new BloomKFilter(TEST_NUM_ENTRIES); + BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { String raw = NullHandling.emptyToNullIfNeeded((String) row.getRaw("dim1")); // empty string extractionFn produces null if (raw == null || "".equals(raw)) { - expected1.addBytes(null, 0, 0); + expectedbl1.addBytes(null, 0, 0); } else { - expected1.addString(raw.substring(0, 1)); + expectedbl1.addString(raw.substring(0, 1)); } } @@ -272,7 +272,7 @@ public void testBloomFilterAggExtractionFn() throws Exception .build() ), ImmutableList.of( - new Object[]{queryFramework().queryJsonMapper().writeValueAsString(expected1)} + new Object[]{queryFramework().queryJsonMapper().writeValueAsString(expectedbl1)} ) ); } @@ -327,17 +327,17 @@ public void testBloomFilterAggLong() throws Exception public void testBloomFilterAggLongVirtualColumn() throws Exception { cannotVectorize(); - BloomKFilter expected1 = new BloomKFilter(TEST_NUM_ENTRIES); + BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { Object raw = row.getRaw("l1"); if (raw == null) { if (NullHandling.replaceWithDefault()) { - expected1.addLong(NullHandling.defaultLongValue()); + expectedbl1.addLong(NullHandling.defaultLongValue()); } else { - expected1.addBytes(null, 0, 0); + expectedbl1.addBytes(null, 0, 0); } } else { - expected1.addLong(2 * ((Number) raw).longValue()); + expectedbl1.addLong(2 * ((Number) raw).longValue()); } } @@ -371,7 +371,7 @@ public void testBloomFilterAggLongVirtualColumn() throws Exception .build() ), ImmutableList.of( - new Object[]{queryFramework().queryJsonMapper().writeValueAsString(expected1)} + new Object[]{queryFramework().queryJsonMapper().writeValueAsString(expectedbl1)} ) ); } @@ -381,17 +381,17 @@ public void testBloomFilterAggFloatVirtualColumn() throws Exception { cannotVectorize(); - BloomKFilter expected1 = new BloomKFilter(TEST_NUM_ENTRIES); + BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { Object raw = row.getRaw("f1"); if (raw == null) { if (NullHandling.replaceWithDefault()) { - expected1.addFloat(NullHandling.defaultFloatValue()); + expectedbl1.addFloat(NullHandling.defaultFloatValue()); } else { - expected1.addBytes(null, 0, 0); + expectedbl1.addBytes(null, 0, 0); } } else { - expected1.addFloat(2 * ((Number) raw).floatValue()); + expectedbl1.addFloat(2 * ((Number) raw).floatValue()); } } @@ -425,7 +425,7 @@ public void testBloomFilterAggFloatVirtualColumn() throws Exception .build() ), ImmutableList.of( - new Object[]{queryFramework().queryJsonMapper().writeValueAsString(expected1)} + new Object[]{queryFramework().queryJsonMapper().writeValueAsString(expectedbl1)} ) ); } @@ -435,23 +435,23 @@ public void testBloomFilterAggDoubleVirtualColumn() throws Exception { cannotVectorize(); - BloomKFilter expected1 = new BloomKFilter(TEST_NUM_ENTRIES); + BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { - Object raw = row.getRaw("d1"); + Object raw = row.getRaw("dbl1"); if (raw == null) { if (NullHandling.replaceWithDefault()) { - expected1.addDouble(NullHandling.defaultDoubleValue()); + expectedbl1.addDouble(NullHandling.defaultDoubleValue()); } else { - expected1.addBytes(null, 0, 0); + expectedbl1.addBytes(null, 0, 0); } } else { - expected1.addDouble(2 * ((Number) raw).doubleValue()); + expectedbl1.addDouble(2 * ((Number) raw).doubleValue()); } } testQuery( "SELECT\n" - + "BLOOM_FILTER(d1 * 2, 1000)\n" + + "BLOOM_FILTER(dbl1 * 2, 1000)\n" + "FROM numfoo", ImmutableList.of( Druids.newTimeseriesQueryBuilder() @@ -461,7 +461,7 @@ public void testBloomFilterAggDoubleVirtualColumn() throws Exception .virtualColumns( new ExpressionVirtualColumn( "v0", - "(\"d1\" * 2)", + "(\"dbl1\" * 2)", ColumnType.DOUBLE, TestExprMacroTable.INSTANCE ) @@ -479,7 +479,7 @@ public void testBloomFilterAggDoubleVirtualColumn() throws Exception .build() ), ImmutableList.of( - new Object[]{queryFramework().queryJsonMapper().writeValueAsString(expected1)} + new Object[]{queryFramework().queryJsonMapper().writeValueAsString(expectedbl1)} ) ); } @@ -490,7 +490,7 @@ public void testEmptyTimeseriesResults() throws Exception // makes empty bloom filters cannotVectorize(); - BloomKFilter expected1 = new BloomKFilter(TEST_NUM_ENTRIES); + BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); BloomKFilter expected2 = new BloomKFilter(TEST_NUM_ENTRIES); ObjectMapper jsonMapper = queryFramework().queryJsonMapper(); @@ -524,7 +524,7 @@ public void testEmptyTimeseriesResults() throws Exception ), ImmutableList.of( new Object[] { - jsonMapper.writeValueAsString(expected1), + jsonMapper.writeValueAsString(expectedbl1), jsonMapper.writeValueAsString(expected2) } ) @@ -537,7 +537,7 @@ public void testGroupByAggregatorDefaultValues() throws Exception // makes empty bloom filters cannotVectorize(); - BloomKFilter expected1 = new BloomKFilter(TEST_NUM_ENTRIES); + BloomKFilter expectedbl1 = new BloomKFilter(TEST_NUM_ENTRIES); BloomKFilter expected2 = new BloomKFilter(TEST_NUM_ENTRIES); ObjectMapper jsonMapper = queryFramework().queryJsonMapper(); @@ -554,7 +554,7 @@ public void testGroupByAggregatorDefaultValues() throws Exception .setDimFilter(equality("dim2", "a", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) - .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( @@ -581,7 +581,7 @@ public void testGroupByAggregatorDefaultValues() throws Exception ImmutableList.of( new Object[] { "a", - jsonMapper.writeValueAsString(expected1), + jsonMapper.writeValueAsString(expectedbl1), jsonMapper.writeValueAsString(expected2) } ) diff --git a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/sql/VarianceSqlAggregatorTest.java b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/sql/VarianceSqlAggregatorTest.java index 0fcc17eee205..15f333a4381e 100644 --- a/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/sql/VarianceSqlAggregatorTest.java +++ b/extensions-core/stats/src/test/java/org/apache/druid/query/aggregation/variance/sql/VarianceSqlAggregatorTest.java @@ -111,7 +111,7 @@ public SpecificSegmentsQuerySegmentWalker createQuerySegmentWalker( new DimensionsSpec( ImmutableList.builder() .addAll(DimensionsSpec.getDefaultSchemas(ImmutableList.of("dim1", "dim2", "dim3"))) - .add(new DoubleDimensionSchema("d1")) + .add(new DoubleDimensionSchema("dbl1")) .add(new FloatDimensionSchema("f1")) .add(new LongDimensionSchema("l1")) .build() @@ -176,7 +176,7 @@ public void testVarPop() VarianceAggregatorCollector holder2 = new VarianceAggregatorCollector(); VarianceAggregatorCollector holder3 = new VarianceAggregatorCollector(); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { - Object raw1 = row.getRaw("d1"); + Object raw1 = row.getRaw("dbl1"); Object raw2 = row.getRaw("f1"); Object raw3 = row.getRaw("l1"); addToHolder(holder1, raw1); @@ -193,7 +193,7 @@ public void testVarPop() ); testQuery( "SELECT\n" - + "VAR_POP(d1),\n" + + "VAR_POP(dbl1),\n" + "VAR_POP(f1),\n" + "VAR_POP(l1)\n" + "FROM numfoo", @@ -204,7 +204,7 @@ public void testVarPop() .granularity(Granularities.ALL) .aggregators( ImmutableList.of( - new VarianceAggregatorFactory("a0", "d1", "population", "double"), + new VarianceAggregatorFactory("a0", "dbl1", "population", "double"), new VarianceAggregatorFactory("a1", "f1", "population", "float"), new VarianceAggregatorFactory("a2", "l1", "population", "long") ) @@ -224,7 +224,7 @@ public void testVarSamp() VarianceAggregatorCollector holder2 = new VarianceAggregatorCollector(); VarianceAggregatorCollector holder3 = new VarianceAggregatorCollector(); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { - Object raw1 = row.getRaw("d1"); + Object raw1 = row.getRaw("dbl1"); Object raw2 = row.getRaw("f1"); Object raw3 = row.getRaw("l1"); addToHolder(holder1, raw1); @@ -241,7 +241,7 @@ public void testVarSamp() ); testQuery( "SELECT\n" - + "VAR_SAMP(d1),\n" + + "VAR_SAMP(dbl1),\n" + "VAR_SAMP(f1),\n" + "VAR_SAMP(l1)\n" + "FROM numfoo", @@ -252,7 +252,7 @@ public void testVarSamp() .granularity(Granularities.ALL) .aggregators( ImmutableList.of( - new VarianceAggregatorFactory("a0", "d1", "sample", "double"), + new VarianceAggregatorFactory("a0", "dbl1", "sample", "double"), new VarianceAggregatorFactory("a1", "f1", "sample", "float"), new VarianceAggregatorFactory("a2", "l1", "sample", "long") ) @@ -272,7 +272,7 @@ public void testStdDevPop() VarianceAggregatorCollector holder2 = new VarianceAggregatorCollector(); VarianceAggregatorCollector holder3 = new VarianceAggregatorCollector(); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { - Object raw1 = row.getRaw("d1"); + Object raw1 = row.getRaw("dbl1"); Object raw2 = row.getRaw("f1"); Object raw3 = row.getRaw("l1"); addToHolder(holder1, raw1); @@ -290,7 +290,7 @@ public void testStdDevPop() testQuery( "SELECT\n" - + "STDDEV_POP(d1),\n" + + "STDDEV_POP(dbl1),\n" + "STDDEV_POP(f1),\n" + "STDDEV_POP(l1)\n" + "FROM numfoo", @@ -301,7 +301,7 @@ public void testStdDevPop() .granularity(Granularities.ALL) .aggregators( ImmutableList.of( - new VarianceAggregatorFactory("a0:agg", "d1", "population", "double"), + new VarianceAggregatorFactory("a0:agg", "dbl1", "population", "double"), new VarianceAggregatorFactory("a1:agg", "f1", "population", "float"), new VarianceAggregatorFactory("a2:agg", "l1", "population", "long") ) @@ -328,7 +328,7 @@ public void testStdDevSamp() VarianceAggregatorCollector holder2 = new VarianceAggregatorCollector(); VarianceAggregatorCollector holder3 = new VarianceAggregatorCollector(); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { - Object raw1 = row.getRaw("d1"); + Object raw1 = row.getRaw("dbl1"); Object raw2 = row.getRaw("f1"); Object raw3 = row.getRaw("l1"); addToHolder(holder1, raw1); @@ -346,7 +346,7 @@ public void testStdDevSamp() testQuery( "SELECT\n" - + "STDDEV_SAMP(d1),\n" + + "STDDEV_SAMP(dbl1),\n" + "STDDEV_SAMP(f1),\n" + "STDDEV_SAMP(l1)\n" + "FROM numfoo", @@ -357,7 +357,7 @@ public void testStdDevSamp() .granularity(Granularities.ALL) .aggregators( ImmutableList.of( - new VarianceAggregatorFactory("a0:agg", "d1", "sample", "double"), + new VarianceAggregatorFactory("a0:agg", "dbl1", "sample", "double"), new VarianceAggregatorFactory("a1:agg", "f1", "sample", "float"), new VarianceAggregatorFactory("a2:agg", "l1", "sample", "long") ) @@ -382,7 +382,7 @@ public void testStdDevWithVirtualColumns() VarianceAggregatorCollector holder2 = new VarianceAggregatorCollector(); VarianceAggregatorCollector holder3 = new VarianceAggregatorCollector(); for (InputRow row : TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS) { - Object raw1 = row.getRaw("d1"); + Object raw1 = row.getRaw("dbl1"); Object raw2 = row.getRaw("f1"); Object raw3 = row.getRaw("l1"); addToHolder(holder1, raw1, 7); @@ -400,7 +400,7 @@ public void testStdDevWithVirtualColumns() testQuery( "SELECT\n" - + "STDDEV(d1*7),\n" + + "STDDEV(dbl1*7),\n" + "STDDEV(f1*7),\n" + "STDDEV(l1*7)\n" + "FROM numfoo", @@ -410,7 +410,7 @@ public void testStdDevWithVirtualColumns() .intervals(new MultipleIntervalSegmentSpec(ImmutableList.of(Filtration.eternity()))) .granularity(Granularities.ALL) .virtualColumns( - BaseCalciteQueryTest.expressionVirtualColumn("v0", "(\"d1\" * 7)", ColumnType.DOUBLE), + BaseCalciteQueryTest.expressionVirtualColumn("v0", "(\"dbl1\" * 7)", ColumnType.DOUBLE), BaseCalciteQueryTest.expressionVirtualColumn("v1", "(\"f1\" * 7)", ColumnType.FLOAT), BaseCalciteQueryTest.expressionVirtualColumn("v2", "(\"l1\" * 7)", ColumnType.LONG) ) @@ -457,7 +457,7 @@ public void testVarianceOrderBy() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(new MultipleIntervalSegmentSpec(ImmutableList.of(Filtration.eternity()))) .setGranularity(Granularities.ALL) - .setDimensions(new DefaultDimensionSpec("dim2", "_d0")) + .setDimensions(new DefaultDimensionSpec("dim2", "d0")) .setAggregatorSpecs( new VarianceAggregatorFactory("a0", "f1", "sample", "float") ) @@ -527,10 +527,10 @@ public void testEmptyTimeseriesResults() { testQuery( "SELECT\n" - + "STDDEV_POP(d1),\n" - + "STDDEV_SAMP(d1),\n" - + "STDDEV(d1),\n" - + "VARIANCE(d1),\n" + + "STDDEV_POP(dbl1),\n" + + "STDDEV_SAMP(dbl1),\n" + + "STDDEV(dbl1),\n" + + "VARIANCE(dbl1),\n" + "STDDEV_POP(l1),\n" + "STDDEV_SAMP(l1),\n" + "STDDEV(l1),\n" @@ -543,10 +543,10 @@ public void testEmptyTimeseriesResults() .granularity(Granularities.ALL) .filters(numericEquality("dim2", 0L, ColumnType.LONG)) .aggregators( - new VarianceAggregatorFactory("a0:agg", "d1", "population", "double"), - new VarianceAggregatorFactory("a1:agg", "d1", "sample", "double"), - new VarianceAggregatorFactory("a2:agg", "d1", "sample", "double"), - new VarianceAggregatorFactory("a3", "d1", "sample", "double"), + new VarianceAggregatorFactory("a0:agg", "dbl1", "population", "double"), + new VarianceAggregatorFactory("a1:agg", "dbl1", "sample", "double"), + new VarianceAggregatorFactory("a2:agg", "dbl1", "sample", "double"), + new VarianceAggregatorFactory("a3", "dbl1", "sample", "double"), new VarianceAggregatorFactory("a4:agg", "l1", "population", "long"), new VarianceAggregatorFactory("a5:agg", "l1", "sample", "long"), new VarianceAggregatorFactory("a6:agg", "l1", "sample", "long"), @@ -579,10 +579,10 @@ public void testGroupByAggregatorDefaultValues() testQuery( "SELECT\n" + "dim2,\n" - + "STDDEV_POP(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + "STDDEV_SAMP(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + "STDDEV(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" - + "VARIANCE(d1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + "STDDEV_POP(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + "STDDEV_SAMP(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + "STDDEV(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + + "VARIANCE(dbl1) FILTER(WHERE dim1 = 'nonexistent'),\n" + "STDDEV_POP(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + "STDDEV_SAMP(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" + "STDDEV(l1) FILTER(WHERE dim1 = 'nonexistent'),\n" @@ -595,23 +595,23 @@ public void testGroupByAggregatorDefaultValues() .setDimFilter(equality("dim2", "a", ColumnType.STRING)) .setGranularity(Granularities.ALL) .setVirtualColumns(expressionVirtualColumn("v0", "'a'", ColumnType.STRING)) - .setDimensions(new DefaultDimensionSpec("v0", "_d0", ColumnType.STRING)) + .setDimensions(new DefaultDimensionSpec("v0", "d0", ColumnType.STRING)) .setAggregatorSpecs( aggregators( new FilteredAggregatorFactory( - new VarianceAggregatorFactory("a0:agg", "d1", "population", "double"), + new VarianceAggregatorFactory("a0:agg", "dbl1", "population", "double"), equality("dim1", "nonexistent", ColumnType.STRING) ), new FilteredAggregatorFactory( - new VarianceAggregatorFactory("a1:agg", "d1", "sample", "double"), + new VarianceAggregatorFactory("a1:agg", "dbl1", "sample", "double"), equality("dim1", "nonexistent", ColumnType.STRING) ), new FilteredAggregatorFactory( - new VarianceAggregatorFactory("a2:agg", "d1", "sample", "double"), + new VarianceAggregatorFactory("a2:agg", "dbl1", "sample", "double"), equality("dim1", "nonexistent", ColumnType.STRING) ), new FilteredAggregatorFactory( - new VarianceAggregatorFactory("a3", "d1", "sample", "double"), + new VarianceAggregatorFactory("a3", "dbl1", "sample", "double"), equality("dim1", "nonexistent", ColumnType.STRING) ), new FilteredAggregatorFactory( diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java index 9a87ffd8bef2..1b3a15eb508a 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java @@ -79,6 +79,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; +import static org.junit.Assume.assumeTrue; /** * These test cases are borrowed from the drill-test-framework at @@ -113,9 +114,12 @@ public class DrillWindowQueryTest extends BaseCalciteQueryTest @Test public void ensureAllDeclared() throws Exception { + assumeTrue(DrillWindowQueryTest.class.equals(getClass())); + final URL windowQueriesUrl = ClassLoader.getSystemResource("drill/window/queries/"); Path windowFolder = new File(windowQueriesUrl.toURI()).toPath(); + Set allCases = FileUtils .streamFiles(windowFolder.toFile(), true, "q") .map(file -> { From 3aff1612716f4f931dfecc629aff9ca8b48cb19c Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 15 Nov 2024 14:12:39 +0000 Subject: [PATCH 42/99] fix fail --- .../org.apache.druid.quidem.QTest/example.iq | 40 +++++++++---------- .../sql/calcite/DrillWindowQueryTest.java | 3 +- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/quidem-ut/src/test/quidem/org.apache.druid.quidem.QTest/example.iq b/quidem-ut/src/test/quidem/org.apache.druid.quidem.QTest/example.iq index 3a8105927eee..f17834033b99 100644 --- a/quidem-ut/src/test/quidem/org.apache.druid.quidem.QTest/example.iq +++ b/quidem-ut/src/test/quidem/org.apache.druid.quidem.QTest/example.iq @@ -3,30 +3,30 @@ !set outputformat mysql select * from numfoo; -+-------------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+ -| __time | dim1 | dim2 | dim3 | dim4 | dim5 | dim6 | d1 | d2 | f1 | f2 | l1 | l2 | cnt | m1 | m2 | unique_dim1 | -+-------------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | | a | ["a","b"] | a | aa | 1 | 1.0 | | 1.0 | | 7 | | 1 | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2000-01-02 00:00:00.000 | 10.1 | | ["b","c"] | a | ab | 2 | 1.7 | 1.7 | 0.1 | 0.1 | 325323 | 325323 | 1 | 2.0 | 2.0 | "AQAAAQAAAAHNBA==" | -| 2000-01-03 00:00:00.000 | 2 | | d | a | ba | 3 | 0.0 | 0.0 | 0.0 | 0.0 | 0 | 0 | 1 | 3.0 | 3.0 | "AQAAAQAAAAOzAg==" | -| 2001-01-01 00:00:00.000 | 1 | a | | b | ad | 4 | | | | | | | 1 | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -| 2001-01-02 00:00:00.000 | def | abc | | b | aa | 5 | | | | | | | 1 | 5.0 | 5.0 | "AQAAAQAAAACyEA==" | -| 2001-01-03 00:00:00.000 | abc | | | b | ab | 6 | | | | | | | 1 | 6.0 | 6.0 | "AQAAAQAAAAEkAQ==" | -+-------------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+ ++-------------------------+------+------+-----------+------+------+------+------+------+-----+-----+--------+--------+-----+-----+-----+--------------------+ +| __time | dim1 | dim2 | dim3 | dim4 | dim5 | dim6 | dbl1 | dbl2 | f1 | f2 | l1 | l2 | cnt | m1 | m2 | unique_dim1 | ++-------------------------+------+------+-----------+------+------+------+------+------+-----+-----+--------+--------+-----+-----+-----+--------------------+ +| 2000-01-01 00:00:00.000 | | a | ["a","b"] | a | aa | 1 | 1.0 | | 1.0 | | 7 | | 1 | 1.0 | 1.0 | "AQAAAEAAAA==" | +| 2000-01-02 00:00:00.000 | 10.1 | | ["b","c"] | a | ab | 2 | 1.7 | 1.7 | 0.1 | 0.1 | 325323 | 325323 | 1 | 2.0 | 2.0 | "AQAAAQAAAAHNBA==" | +| 2000-01-03 00:00:00.000 | 2 | | d | a | ba | 3 | 0.0 | 0.0 | 0.0 | 0.0 | 0 | 0 | 1 | 3.0 | 3.0 | "AQAAAQAAAAOzAg==" | +| 2001-01-01 00:00:00.000 | 1 | a | | b | ad | 4 | | | | | | | 1 | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | +| 2001-01-02 00:00:00.000 | def | abc | | b | aa | 5 | | | | | | | 1 | 5.0 | 5.0 | "AQAAAQAAAACyEA==" | +| 2001-01-03 00:00:00.000 | abc | | | b | ab | 6 | | | | | | | 1 | 6.0 | 6.0 | "AQAAAQAAAAEkAQ==" | ++-------------------------+------+------+-----------+------+------+------+------+------+-----+-----+--------+--------+-----+-----+-----+--------------------+ (6 rows) !ok select * from numfoo; -+-------------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+ -| __time | dim1 | dim2 | dim3 | dim4 | dim5 | dim6 | d1 | d2 | f1 | f2 | l1 | l2 | cnt | m1 | m2 | unique_dim1 | -+-------------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+ -| 2000-01-01 00:00:00.000 | | a | ["a","b"] | a | aa | 1 | 1.0 | | 1.0 | | 7 | | 1 | 1.0 | 1.0 | "AQAAAEAAAA==" | -| 2000-01-02 00:00:00.000 | 10.1 | | ["b","c"] | a | ab | 2 | 1.7 | 1.7 | 0.1 | 0.1 | 325323 | 325323 | 1 | 2.0 | 2.0 | "AQAAAQAAAAHNBA==" | -| 2000-01-03 00:00:00.000 | 2 | | d | a | ba | 3 | 0.0 | 0.0 | 0.0 | 0.0 | 0 | 0 | 1 | 3.0 | 3.0 | "AQAAAQAAAAOzAg==" | -| 2001-01-01 00:00:00.000 | 1 | a | | b | ad | 4 | | | | | | | 1 | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | -| 2001-01-02 00:00:00.000 | def | abc | | b | aa | 5 | | | | | | | 1 | 5.0 | 5.0 | "AQAAAQAAAACyEA==" | -| 2001-01-03 00:00:00.000 | abc | | | b | ab | 6 | | | | | | | 1 | 6.0 | 6.0 | "AQAAAQAAAAEkAQ==" | -+-------------------------+------+------+-----------+------+------+------+-----+-----+-----+-----+--------+--------+-----+-----+-----+--------------------+ ++-------------------------+------+------+-----------+------+------+------+------+------+-----+-----+--------+--------+-----+-----+-----+--------------------+ +| __time | dim1 | dim2 | dim3 | dim4 | dim5 | dim6 | dbl1 | dbl2 | f1 | f2 | l1 | l2 | cnt | m1 | m2 | unique_dim1 | ++-------------------------+------+------+-----------+------+------+------+------+------+-----+-----+--------+--------+-----+-----+-----+--------------------+ +| 2000-01-01 00:00:00.000 | | a | ["a","b"] | a | aa | 1 | 1.0 | | 1.0 | | 7 | | 1 | 1.0 | 1.0 | "AQAAAEAAAA==" | +| 2000-01-02 00:00:00.000 | 10.1 | | ["b","c"] | a | ab | 2 | 1.7 | 1.7 | 0.1 | 0.1 | 325323 | 325323 | 1 | 2.0 | 2.0 | "AQAAAQAAAAHNBA==" | +| 2000-01-03 00:00:00.000 | 2 | | d | a | ba | 3 | 0.0 | 0.0 | 0.0 | 0.0 | 0 | 0 | 1 | 3.0 | 3.0 | "AQAAAQAAAAOzAg==" | +| 2001-01-01 00:00:00.000 | 1 | a | | b | ad | 4 | | | | | | | 1 | 4.0 | 4.0 | "AQAAAQAAAAFREA==" | +| 2001-01-02 00:00:00.000 | def | abc | | b | aa | 5 | | | | | | | 1 | 5.0 | 5.0 | "AQAAAQAAAACyEA==" | +| 2001-01-03 00:00:00.000 | abc | | | b | ab | 6 | | | | | | | 1 | 6.0 | 6.0 | "AQAAAQAAAAEkAQ==" | ++-------------------------+------+------+-----------+------+------+------+------+------+-----+-----+--------+--------+-----+-----+-----+--------------------+ (6 rows) !ok diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java index 1b3a15eb508a..7c21e7f655f7 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java @@ -55,6 +55,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; + import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -79,7 +80,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeTrue; +import static org.junit.jupiter.api.Assumptions.assumeTrue; /** * These test cases are borrowed from the drill-test-framework at From 797f35de1eaef4a157359bb58f255d2972ee2805 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 15 Nov 2024 14:19:26 +0000 Subject: [PATCH 43/99] celanup --- .../calcite/planner/DruidRelFieldTrimmer.java | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 2484e541fa2c..95b8a65e9027 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -62,18 +62,6 @@ public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuil this.trimTableScan = trimTableScan; } - @Override - protected TrimResult dummyProject(int fieldCount, RelNode input) - { - Mapping mapping = Mappings.createIdentity(input.getRowType().getFieldCount()); - // mapping = Mappings.create( - // MappingType.INVERSE_SURJECTION, - // fieldCount, - // 0 - // ); - return result(input, mapping); - } - public TrimResult trimFields( final TableScan tableAccessRel, ImmutableBitSet fieldsUsed, @@ -91,13 +79,6 @@ public TrimResult trimFields(LogicalCorrelate correlate, ImmutableBitSet fieldsUsed, Set extraFields) { - - // final RelDataType rowType = correlate.getRowType(); - // final int fieldCount = rowType.getFieldCount(); - // final RelNode left = correlate.getLeft(); - // final RelNode right = correlate.getRight(); - // final RelDataType rightRowType = right.getRowType(); - // final int rightFieldCount = rightRowType.getFieldCount(); if (!extraFields.isEmpty()) { // bail out with generic trim return trimFields((RelNode) correlate, fieldsUsed, extraFields); @@ -137,7 +118,7 @@ public TrimResult trimFields(LogicalCorrelate correlate, offset += inputFieldCount; } - if (changeCount < -1) { + if (changeCount == 0) { return result(correlate, Mappings.createIdentity(correlate.getRowType().getFieldCount())); } @@ -181,6 +162,7 @@ public TrimResult trimFields(LogicalUnnest correlate, .build(); RelNode input = correlate.getInput(); + // Create input with trimmed columns. TrimResult trimResult = trimChild(correlate, input, inputFieldsUsed, extraFields); @@ -189,7 +171,6 @@ public TrimResult trimFields(LogicalUnnest correlate, if (newInput == input) { return result(correlate, Mappings.createIdentity(correlate.getRowType().getFieldCount())); - } Mapping mapping = makeMapping(ImmutableList.of(inputMapping, Mappings.createIdentity(1))); @@ -197,7 +178,7 @@ public TrimResult trimFields(LogicalUnnest correlate, final RexVisitor shuttle = new RexPermuteInputsShuttle(inputMapping, newInput); RexNode newUnnestExpr = correlate.getUnnestExpr().accept(shuttle); - RexNode newFilterExpr = null; + RexNode newFilterExpr = correlate.getFilter(); if (correlate.getFilter() != null) { newFilterExpr = correlate.getFilter().accept(shuttle); } From 8800763484a1ea531bd56b3a0f52ee3b898ca10f Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 15 Nov 2024 14:20:17 +0000 Subject: [PATCH 44/99] correct indent --- .../druid/sql/calcite/planner/DruidRelFieldTrimmer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 95b8a65e9027..41bced40edde 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -196,8 +196,12 @@ public TrimResult trimFields(LogicalUnnest correlate, /** * Concatenates multiple mapping. * - * [ 1:0, 2:1] // sourceCount:100 [ 1:0, 2:1] // sourceCount:100 output: [ - * 1:0, 2:1, 101:2, 102:3 ] ; sourceCount:200 + *

+   * [ 1:0, 2:1] // sourceCount:100
+   * [ 1:0, 2:1] // sourceCount:100
+   * output:
+   * [ 1:0, 2:1, 101:2, 102:3 ] ; sourceCount:200
+   * 
*/ private Mapping makeMapping(List inputMappings) { From 7e46880aace7eb07cafaaa2ae644fd3f31a17ae5 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 15 Nov 2024 14:23:56 +0000 Subject: [PATCH 45/99] cleanup --- .../calcite/planner/DruidRelFieldTrimmer.java | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 41bced40edde..deb06cd7c2dc 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -52,13 +52,11 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer { - private RelBuilder relBuilder; private boolean trimTableScan; public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuilder, boolean trimTableScan) { super(validator, relBuilder); - this.relBuilder = relBuilder; this.trimTableScan = trimTableScan; } @@ -123,12 +121,14 @@ public TrimResult trimFields(LogicalCorrelate correlate, } Mapping mapping = makeMapping(inputMappings); + RexBuilder rexBuilder = correlate.getCluster().getRexBuilder(); + final LogicalCorrelate newCorrelate = correlate.copy( correlate.getTraitSet(), newInputs.get(0), newInputs.get(1).accept( new RelVistatorRelShuttle( - new CorrelateExprMapping(correlate.getCorrelationId(), newInputs.get(0).getRowType(), mapping) + new CorrelateExprMapping(correlate.getCorrelationId(), newInputs.get(0).getRowType(), mapping, rexBuilder) ) ), correlate.getCorrelationId(), @@ -233,31 +233,27 @@ private Mapping makeMapping(List inputMappings) class CorrelateExprMapping extends RexShuttle { private final CorrelationId correlationId; - private Mapping mapping; - private RelDataType newCorrelRowType; + private final Mapping mapping; + private final RelDataType newCorrelRowType; + private final RexBuilder rexBuilder; - public CorrelateExprMapping(final CorrelationId correlationId, RelDataType newCorrelRowType, Mapping mapping) + public CorrelateExprMapping(final CorrelationId correlationId, RelDataType newCorrelRowType, Mapping mapping, RexBuilder rexBuilder) { this.correlationId = correlationId; this.newCorrelRowType = newCorrelRowType; this.mapping = mapping; + this.rexBuilder = rexBuilder; } @Override public RexNode visitFieldAccess(final RexFieldAccess fieldAccess) { - RexNode referenceExpr1 = fieldAccess.getReferenceExpr(); - if (referenceExpr1 instanceof RexCorrelVariable) { - RexCorrelVariable referenceExpr = (RexCorrelVariable) referenceExpr1; + if (fieldAccess.getReferenceExpr() instanceof RexCorrelVariable) { + RexCorrelVariable referenceExpr = (RexCorrelVariable) fieldAccess.getReferenceExpr(); final RexCorrelVariable encounteredCorrelationId = referenceExpr; if (encounteredCorrelationId.id.equals(correlationId)) { - - RexBuilder rb = relBuilder.getRexBuilder(); int sourceIndex = fieldAccess.getField().getIndex(); - ; - RexFieldAccess a = (RexFieldAccess) rb.makeFieldAccess(map(referenceExpr), mapping.getTarget(sourceIndex)); - - return a; + return rexBuilder.makeFieldAccess(map(referenceExpr), mapping.getTarget(sourceIndex)); } } return super.visitFieldAccess(fieldAccess); @@ -265,9 +261,7 @@ public RexNode visitFieldAccess(final RexFieldAccess fieldAccess) private RexNode map(RexCorrelVariable referenceExpr) { - RexBuilder rb = relBuilder.getRexBuilder(); - return rb.makeCorrel(newCorrelRowType, referenceExpr.id); - + return rexBuilder.makeCorrel(newCorrelRowType, referenceExpr.id); } } From d2e97da900fb3252caaefe376dbc869bceacd1f0 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 15 Nov 2024 14:40:13 +0000 Subject: [PATCH 46/99] add back dummyproject --- .../druid/sql/calcite/planner/DruidRelFieldTrimmer.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index deb06cd7c2dc..d13aaf4ce6d3 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -60,6 +60,13 @@ public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuil this.trimTableScan = trimTableScan; } + @Override + protected TrimResult dummyProject(int fieldCount, RelNode input) + { + Mapping mapping = Mappings.createIdentity(input.getRowType().getFieldCount()); + return result(input, mapping); + } + public TrimResult trimFields( final TableScan tableAccessRel, ImmutableBitSet fieldsUsed, From 0378e652160599c33e466d9a2ce536881efbd580 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 15 Nov 2024 15:22:07 +0000 Subject: [PATCH 47/99] trimmed --- .../unnest.iq | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sql/src/test/quidem/org.apache.druid.quidem.SqlQuidemTest/unnest.iq b/sql/src/test/quidem/org.apache.druid.quidem.SqlQuidemTest/unnest.iq index 83158de5cb8e..36b94603aa0c 100644 --- a/sql/src/test/quidem/org.apache.druid.quidem.SqlQuidemTest/unnest.iq +++ b/sql/src/test/quidem/org.apache.druid.quidem.SqlQuidemTest/unnest.iq @@ -17,11 +17,12 @@ LogicalProject(d3=[$17]) !convertedPlan -LogicalProject(d3=[$18]) - LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{17}]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], $f17=[MV_TO_ARRAY($3)]) - LogicalFilter(condition=[=($2, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) +LogicalProject(d3=[$1]) + LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{0}]) + LogicalProject($f17=[MV_TO_ARRAY($1)]) + LogicalFilter(condition=[=($0, 'a')]) + LogicalProject(dim2=[$2], dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) Uncollect LogicalProject(EXPR$0=[$cor0.$f17]) LogicalValues(tuples=[[{ 0 }]]) @@ -29,10 +30,10 @@ LogicalProject(d3=[$18]) !logicalPlan LogicalProject(d3=[$17]) - LogicalCorrelate(correlation=[$cor2], joinType=[inner], requiredColumns=[{3}]) + LogicalCorrelate(correlation=[$cor1], joinType=[inner], requiredColumns=[{3}]) LogicalFilter(condition=[=($2, 'a')]) LogicalTableScan(table=[[druid, numfoo]]) - DruidUnnestRel(expr=[MV_TO_ARRAY($cor2.dim3)], filter=[null]) + DruidUnnestRel(expr=[MV_TO_ARRAY($cor1.dim3)], filter=[null]) !druidPlan { From 400c05e0ca09a5c1f88f2a14a9357c03155b63d0 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 15 Nov 2024 15:29:11 +0000 Subject: [PATCH 48/99] last trim possibly nbot needed --- .../druid/sql/calcite/planner/CalciteRulesManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 20b51f1e5251..9e1fa71575d3 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -296,9 +296,9 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder2.addRuleInstance(CoreRules.PROJECT_MERGE); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(false), - Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(false) + new DruidTrimFieldsProgram(true), + Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE) +// new DruidTrimFieldsProgram(false) ); } From 79c489cb88fe006a75d7956f213f54627f9b26eb Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 15 Nov 2024 15:46:49 +0000 Subject: [PATCH 49/99] ;stuf --- .../calcite/planner/CalciteRulesManager.java | 5 ++++- .../calcite/planner/DruidRelFieldTrimmer.java | 1 + .../testUnnestWithGroupByHavingSelector.iq | 18 ++++++++---------- ...ingWithWhereOnUnnestCol@NullHandling=sql.iq | 18 ++++++++---------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 9e1fa71575d3..796ff642a9e5 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -35,6 +35,7 @@ import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.RelFactories; import org.apache.calcite.rel.metadata.DefaultRelMetadataProvider; +import org.apache.calcite.rel.rules.AggregateProjectMergeRule; import org.apache.calcite.rel.rules.CoreRules; import org.apache.calcite.rel.rules.DateRangeRules; import org.apache.calcite.rel.rules.FilterCorrelateRule; @@ -294,11 +295,13 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder2.addRuleInstance(new UnnestInputCleanupRule()); builder2.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); builder2.addRuleInstance(CoreRules.PROJECT_MERGE); + builder2.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), new DruidTrimFieldsProgram(true), + Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE), + new DruidTrimFieldsProgram(false), Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE) -// new DruidTrimFieldsProgram(false) ); } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index d13aaf4ce6d3..d96ef269c7ea 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -173,6 +173,7 @@ public TrimResult trimFields(LogicalUnnest correlate, // Create input with trimmed columns. TrimResult trimResult = trimChild(correlate, input, inputFieldsUsed, extraFields); + RelNode newInput = trimResult.left; final Mapping inputMapping = trimResult.right; diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq index e4da1c5d5e58..1b669dbde152 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq @@ -18,18 +18,16 @@ SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) (1 row) !ok -LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalProject(EXPR$0=[$2]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'b')]) - LogicalProject(__time=[$0], dim3=[$3]) - LogicalTableScan(table=[[druid, numfoo]]) +LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'b')]) + LogicalProject(__time=[$0], dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidProject(EXPR$0=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'b')]) - DruidProject(__time=[$0], dim3=[$3], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) +DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'b')]) + DruidProject(__time=[$0], dim3=[$3], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq index c2ae75aacc1f..ac65b537c651 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq @@ -18,18 +18,16 @@ SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) (1 row) !ok -LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalProject(EXPR$0=[$2]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'a')]) - LogicalProject(__time=[$0], dim3=[$3]) - LogicalTableScan(table=[[druid, numfoo]]) +LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'a')]) + LogicalProject(__time=[$0], dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidProject(EXPR$0=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'a')]) - DruidProject(__time=[$0], dim3=[$3], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) +DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'a')]) + DruidProject(__time=[$0], dim3=[$3], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { From d4ebca947ca8d259c0a50feeeac805fd67f7c45f Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 20 Nov 2024 16:27:15 +0000 Subject: [PATCH 50/99] enable trimmer to create blinding project --- .../calcite/planner/DruidRelFieldTrimmer.java | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index d96ef269c7ea..bf3337531e26 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -20,6 +20,7 @@ package org.apache.druid.sql.calcite.planner; import com.google.common.collect.ImmutableList; +import org.apache.calcite.plan.RelOptCluster; import org.apache.calcite.plan.RelOptUtil; import org.apache.calcite.rel.RelHomogeneousShuttle; import org.apache.calcite.rel.RelNode; @@ -47,21 +48,49 @@ import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Set; public class DruidRelFieldTrimmer extends RelFieldTrimmer { - private boolean trimTableScan; + private final boolean trimTableScan; + private final RelBuilder relBuilder; public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuilder, boolean trimTableScan) { super(validator, relBuilder); + this.relBuilder = relBuilder; this.trimTableScan = trimTableScan; } @Override protected TrimResult dummyProject(int fieldCount, RelNode input) + { + return makeIdentityMapping(input); + } + + protected TrimResult dummyProject(int fieldCount, RelNode input, + @Nullable RelNode originalRelNode) + { + final RelOptCluster cluster = input.getCluster(); + final Mapping mapping = + Mappings.create(MappingType.INVERSE_SURJECTION, fieldCount, 0); + if (input.getRowType().getFieldCount() == 0) { + // Input already has one field (and may in fact be a dummy project we + // created for the child). We can't do better. + return result(input, mapping); + } + relBuilder.push(input); + relBuilder.project(Collections.emptyList(), Collections.emptyList()); + RelNode newProject = relBuilder.build(); + if (originalRelNode != null) { + newProject = RelOptUtil.propagateRelHints(originalRelNode, newProject); + } + return result(newProject, mapping); + } + + private TrimResult makeIdentityMapping(RelNode input) { Mapping mapping = Mappings.createIdentity(input.getRowType().getFieldCount()); return result(input, mapping); From 0c6b40c138f2be8a7394f676ae24d5d256511fb3 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 20 Nov 2024 16:30:24 +0000 Subject: [PATCH 51/99] update --- .../druid/sql/calcite/planner/DruidRelFieldTrimmer.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index bf3337531e26..5b2c84f5d402 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -20,7 +20,6 @@ package org.apache.druid.sql.calcite.planner; import com.google.common.collect.ImmutableList; -import org.apache.calcite.plan.RelOptCluster; import org.apache.calcite.plan.RelOptUtil; import org.apache.calcite.rel.RelHomogeneousShuttle; import org.apache.calcite.rel.RelNode; @@ -73,12 +72,9 @@ protected TrimResult dummyProject(int fieldCount, RelNode input) protected TrimResult dummyProject(int fieldCount, RelNode input, @Nullable RelNode originalRelNode) { - final RelOptCluster cluster = input.getCluster(); - final Mapping mapping = - Mappings.create(MappingType.INVERSE_SURJECTION, fieldCount, 0); + final Mapping mapping = Mappings.create(MappingType.INVERSE_SURJECTION, fieldCount, 0); if (input.getRowType().getFieldCount() == 0) { - // Input already has one field (and may in fact be a dummy project we - // created for the child). We can't do better. + // there is no need to do anything return result(input, mapping); } relBuilder.push(input); From bdfcef82207b62ec69718002c8b715386ebf0b78 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 21 Nov 2024 08:12:49 +0000 Subject: [PATCH 52/99] add note; conditional --- .../druid/sql/calcite/planner/DruidRelFieldTrimmer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 5b2c84f5d402..50ec4eb66674 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -72,6 +72,10 @@ protected TrimResult dummyProject(int fieldCount, RelNode input) protected TrimResult dummyProject(int fieldCount, RelNode input, @Nullable RelNode originalRelNode) { + if (fieldCount != 0) { + return super.dummyProject(fieldCount, input, originalRelNode); + } + // workaround to support fieldCount == 0 projections final Mapping mapping = Mappings.create(MappingType.INVERSE_SURJECTION, fieldCount, 0); if (input.getRowType().getFieldCount() == 0) { // there is no need to do anything From 5ca3f14813aac49f8ac38aa2885c26c8123e1305 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 21 Nov 2024 13:29:25 +0000 Subject: [PATCH 53/99] more sophisiticated filter --- .../apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 50ec4eb66674..7be8473d0d2e 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -72,7 +72,7 @@ protected TrimResult dummyProject(int fieldCount, RelNode input) protected TrimResult dummyProject(int fieldCount, RelNode input, @Nullable RelNode originalRelNode) { - if (fieldCount != 0) { + if (fieldCount != 0 && trimTableScan) { return super.dummyProject(fieldCount, input, originalRelNode); } // workaround to support fieldCount == 0 projections From 34426e184eeadbfef2e702215ba6894d6b17606f Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 3 Dec 2024 03:51:43 +0000 Subject: [PATCH 54/99] remove ds2 --- .../org/apache/druid/sql/calcite/BaseCalciteQueryTest.java | 5 ----- .../org/apache/druid/sql/calcite/CalciteArraysQueryTest.java | 4 ++-- .../testGroupByWithLiteralInSubqueryGrouping.iq | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java index 0adcd4bcb670..15dfa2449683 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java @@ -1674,9 +1674,4 @@ public String ds(String colName) return "_" + colName; } } - - public String ds2(String colName) - { - return ds(ds(colName)); - } } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 76207da341b9..395492c9e214 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -6995,13 +6995,13 @@ public void testUnnestWithTimeFilterOnlyNestedAndNestedAgain() expressionVirtualColumn(ds("j0.unnest"), "array(\"dim1\",\"dim2\")", ColumnType.STRING_ARRAY), null ), - nestedExpressionVirtualColumn(ds2("j0.unnest"), "\"dim3\"", ColumnType.STRING), + nestedExpressionVirtualColumn(ds(ds("j0.unnest")), "\"dim3\"", ColumnType.STRING), null )) .intervals(querySegmentSpec(Intervals.of("2000-01-02T00:00:00.000Z/2000-01-03T00:10:00.001Z"))) .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) .context(QUERY_CONTEXT_UNNEST) - .columns(ds2("j0.unnest")) + .columns(ds(ds("j0.unnest"))) .columnTypes(ColumnType.STRING) .build() ), diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq index 65cce7cc14b4..da905b0336c1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq @@ -30,8 +30,8 @@ SELECT +-------+----+ | t1 | t2 | +-------+----+ -| dummy | b | | dummy | | +| dummy | b | +-------+----+ (2 rows) From d536217624a7d9fd78ca85af49d484983e5339c4 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 15:13:25 +0000 Subject: [PATCH 55/99] renames --- .../sql/calcite/planner/DruidRelFieldTrimmer.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 7be8473d0d2e..175d6b88010d 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -163,8 +163,8 @@ public TrimResult trimFields(LogicalCorrelate correlate, correlate.getTraitSet(), newInputs.get(0), newInputs.get(1).accept( - new RelVistatorRelShuttle( - new CorrelateExprMapping(correlate.getCorrelationId(), newInputs.get(0).getRowType(), mapping, rexBuilder) + new RexRewritingRelShuttle( + new RexCorrelVariableMapShuttle(correlate.getCorrelationId(), newInputs.get(0).getRowType(), mapping, rexBuilder) ) ), correlate.getCorrelationId(), @@ -267,14 +267,14 @@ private Mapping makeMapping(List inputMappings) return mapping; } - class CorrelateExprMapping extends RexShuttle + static class RexCorrelVariableMapShuttle extends RexShuttle { private final CorrelationId correlationId; private final Mapping mapping; private final RelDataType newCorrelRowType; private final RexBuilder rexBuilder; - public CorrelateExprMapping(final CorrelationId correlationId, RelDataType newCorrelRowType, Mapping mapping, RexBuilder rexBuilder) + public RexCorrelVariableMapShuttle(final CorrelationId correlationId, RelDataType newCorrelRowType, Mapping mapping, RexBuilder rexBuilder) { this.correlationId = correlationId; this.newCorrelRowType = newCorrelRowType; @@ -302,11 +302,11 @@ private RexNode map(RexCorrelVariable referenceExpr) } } - public class RelVistatorRelShuttle extends RelHomogeneousShuttle + static class RexRewritingRelShuttle extends RelHomogeneousShuttle { private final RexShuttle rexVisitor; - RelVistatorRelShuttle(RexShuttle rexVisitor) + RexRewritingRelShuttle(RexShuttle rexVisitor) { this.rexVisitor = rexVisitor; } From 8cb117878267407cb9a146b9fdb7ca0d64bcb992 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 15:31:58 +0000 Subject: [PATCH 56/99] its ok --- .../main/java/org/apache/druid/query/QueryContexts.java | 2 +- .../druid/sql/calcite/planner/CalciteRulesManager.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/processing/src/main/java/org/apache/druid/query/QueryContexts.java b/processing/src/main/java/org/apache/druid/query/QueryContexts.java index 4c4600fa789d..950dea52e907 100644 --- a/processing/src/main/java/org/apache/druid/query/QueryContexts.java +++ b/processing/src/main/java/org/apache/druid/query/QueryContexts.java @@ -132,7 +132,7 @@ public class QueryContexts public static final boolean DEFAULT_ENABLE_SQL_JOIN_LEFT_SCAN_DIRECT = false; public static final boolean DEFAULT_USE_FILTER_CNF = false; public static final boolean DEFAULT_SECONDARY_PARTITION_PRUNING = true; - public static final boolean DEFAULT_ENABLE_DEBUG = true; + public static final boolean DEFAULT_ENABLE_DEBUG = false; public static final int DEFAULT_IN_SUB_QUERY_THRESHOLD = Integer.MAX_VALUE; public static final int DEFAULT_IN_FUNCTION_THRESHOLD = 100; public static final int DEFAULT_IN_FUNCTION_EXPR_THRESHOLD = 2; diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 796ff642a9e5..ae9eb8d0366f 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -283,13 +283,17 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder.addMatchLimit(CalciteRulesManager.HEP_DEFAULT_MATCH_LIMIT); builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); + builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); + builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); + + builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); - builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); - builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); + + final HepProgramBuilder builder2 = HepProgram.builder(); builder2.addRuleInstance(new LogicalUnnestRule()); builder2.addRuleInstance(new UnnestInputCleanupRule()); From e7afacea9477335b5c731b6e567bad03f0574903 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 15:37:08 +0000 Subject: [PATCH 57/99] reduce --- .../druid/sql/calcite/planner/CalciteRulesManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index ae9eb8d0366f..342a7233a9d8 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -281,17 +281,22 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC { final HepProgramBuilder builder = HepProgram.builder(); builder.addMatchLimit(CalciteRulesManager.HEP_DEFAULT_MATCH_LIMIT); + builder.addGroupBegin(); builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); + builder.addGroupEnd(); + builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); + builder.addGroupBegin(); builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); + builder.addGroupEnd(); final HepProgramBuilder builder2 = HepProgram.builder(); @@ -304,8 +309,7 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), new DruidTrimFieldsProgram(true), Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(false), - Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE) + new DruidTrimFieldsProgram(false) ); } From 2c7113398134b3ca19055c368af939e71476996b Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 16:28:14 +0000 Subject: [PATCH 58/99] x --- .../druid/sql/calcite/planner/CalciteRulesManager.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 342a7233a9d8..0c69ea379ce0 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -281,22 +281,21 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC { final HepProgramBuilder builder = HepProgram.builder(); builder.addMatchLimit(CalciteRulesManager.HEP_DEFAULT_MATCH_LIMIT); - builder.addGroupBegin(); +// builder.addGroupBegin(); builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); - builder.addGroupEnd(); +// builder.addGroupEnd(); builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); - - builder.addGroupBegin(); +// builder.addGroupBegin(); builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); - builder.addGroupEnd(); +// builder.addGroupEnd(); final HepProgramBuilder builder2 = HepProgram.builder(); From 285d178f49f01f1b31683a4914a6da04e97bec90 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 17:09:23 +0000 Subject: [PATCH 59/99] dont care about filter; it only references unnest col --- .../druid/sql/calcite/planner/DruidRelFieldTrimmer.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 175d6b88010d..5c6b21a2e2b6 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -186,9 +186,6 @@ public TrimResult trimFields(LogicalUnnest correlate, RelOptUtil.InputFinder inputFinder = new RelOptUtil.InputFinder(extraFields); correlate.getUnnestExpr().accept(inputFinder); - if (correlate.getFilter() != null) { - correlate.getFilter().accept(inputFinder); - } ImmutableBitSet finderFields = inputFinder.build(); @@ -216,9 +213,6 @@ public TrimResult trimFields(LogicalUnnest correlate, RexNode newUnnestExpr = correlate.getUnnestExpr().accept(shuttle); RexNode newFilterExpr = correlate.getFilter(); - if (correlate.getFilter() != null) { - newFilterExpr = correlate.getFilter().accept(shuttle); - } final LogicalUnnest newCorrelate = correlate.copy( correlate.getTraitSet(), From 6d577f84683b8278dabb376ff6f756b9b47d8e5d Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 17:09:42 +0000 Subject: [PATCH 60/99] some stuf --- .../sql/calcite/planner/CalciteRulesManager.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 0c69ea379ce0..75359855cfd5 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -305,10 +305,15 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder2.addRuleInstance(CoreRules.PROJECT_MERGE); builder2.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); return Programs.sequence( + new LoggingProgram("__decStart", true), Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(true), + new LoggingProgram("__decAfterBuild1", true), + new DruidTrimFieldsProgram(false), + new LoggingProgram("__decAfterTrim1", true), Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(false) + new LoggingProgram("__decAfterBuild2", true), + new DruidTrimFieldsProgram(false), + new LoggingProgram("__decAfterTrim2", true) ); } @@ -564,7 +569,7 @@ public RelNode run( { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); final RelNode decorrelatedRel = RelDecorrelator.decorrelateQuery(rel, relBuilder); - return runFieldTrimmer2(relBuilder, decorrelatedRel); + return runFieldTrimmer(relBuilder, decorrelatedRel); } } From 3f3335f6fe0bbc4f83f7f74bd8790a37fcb86952 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 17:19:30 +0000 Subject: [PATCH 61/99] updates --- s | 22 +++++++++++++++++++ s2 | 22 +++++++++++++++++++ .../calcite/planner/CalciteRulesManager.java | 22 +++++-------------- 3 files changed, 49 insertions(+), 17 deletions(-) create mode 100644 s create mode 100644 s2 diff --git a/s b/s new file mode 100644 index 000000000000..c9145cd9fe67 --- /dev/null +++ b/s @@ -0,0 +1,22 @@ +2024-12-04T16:38:13,926 INFO [main] org.apache.druid.sql.calcite.planner.CalciteRulesManager - __decAfterTrim1 +LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3]): rowcount = 3.75, cumulative cost = {inf}, id = 1092 + LogicalCorrelate(correlation=[$cor2], joinType=[inner], requiredColumns=[{0}]): rowcount = 3.75, cumulative cost = {inf}, id = 1091 + LogicalProject(arrayStringNulls=[$0], uln=[$2], udn=[$3]): rowcount = 3.75, cumulative cost = {inf}, id = 1085 + LogicalFilter(condition=[OR(=($2, 1), =($3, 2.2))]): rowcount = 3.75, cumulative cost = {inf}, id = 1084 + LogicalCorrelate(correlation=[$cor1], joinType=[inner], requiredColumns=[{1}]): rowcount = 15.0, cumulative cost = {inf}, id = 1083 + LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3]): rowcount = 15.0, cumulative cost = {inf}, id = 1079 + LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{1}]): rowcount = 15.0, cumulative cost = {inf}, id = 1078 + LogicalProject(arrayStringNulls=[$1], arrayLongNulls=[$2], arrayDoubleNulls=[$3]): rowcount = 15.0, cumulative cost = {230.0 rows, 646.0 cpu, 0.0 io}, id = 1074 + LogicalFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]): rowcount = 15.0, cumulative cost = {215.0 rows, 601.0 cpu, 0.0 io}, id = 1073 + LogicalProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]): rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id = 1072 + LogicalTableScan(table=[[druid, arrays]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 640 + Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1077 + LogicalProject(arrayLongNulls=[$cor0.arrayLongNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1076 + LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 641 + Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1082 + LogicalProject(arrayDoubleNulls=[$cor1.arrayDoubleNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1081 + LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 647 + LogicalFilter(condition=[=($0, 'a')]): rowcount = 1.0, cumulative cost = {4.0 rows, 4.0 cpu, 0.0 io}, id = 1090 + Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1089 + LogicalProject(arrayStringNulls=[$cor2.arrayStringNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1088 + LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 653 diff --git a/s2 b/s2 new file mode 100644 index 000000000000..0aba204521b9 --- /dev/null +++ b/s2 @@ -0,0 +1,22 @@ +2024-12-04T16:50:39,077 INFO [main] org.apache.druid.sql.calcite.planner.CalciteRulesManager - __decAfterTrim1 +LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3]): rowcount = 3.75, cumulative cost = {inf}, id = 1072 + LogicalCorrelate(correlation=[$cor2], joinType=[inner], requiredColumns=[{0}]): rowcount = 3.75, cumulative cost = {inf}, id = 1071 + LogicalProject(arrayStringNulls=[$0], uln=[$2], udn=[$3]): rowcount = 3.75, cumulative cost = {inf}, id = 1065 + LogicalFilter(condition=[OR(=($2, 1), =($3, 2.2))]): rowcount = 3.75, cumulative cost = {inf}, id = 1064 + LogicalCorrelate(correlation=[$cor1], joinType=[inner], requiredColumns=[{1}]): rowcount = 15.0, cumulative cost = {inf}, id = 1063 + LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3]): rowcount = 15.0, cumulative cost = {inf}, id = 1059 + LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{1}]): rowcount = 15.0, cumulative cost = {inf}, id = 1058 + LogicalProject(arrayStringNulls=[$1], arrayLongNulls=[$2], arrayDoubleNulls=[$3]): rowcount = 15.0, cumulative cost = {230.0 rows, 646.0 cpu, 0.0 io}, id = 1054 + LogicalFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]): rowcount = 15.0, cumulative cost = {215.0 rows, 601.0 cpu, 0.0 io}, id = 1053 + LogicalProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]): rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id = 1052 + LogicalTableScan(table=[[druid, arrays]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 630 + Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1057 + LogicalProject(arrayLongNulls=[$cor0.arrayLongNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1056 + LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 631 + Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1062 + LogicalProject(arrayDoubleNulls=[$cor1.arrayDoubleNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1061 + LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 637 + LogicalFilter(condition=[=($0, 'a')]): rowcount = 1.0, cumulative cost = {4.0 rows, 4.0 cpu, 0.0 io}, id = 1070 + Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1069 + LogicalProject(arrayStringNulls=[$cor2.arrayStringNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1068 + LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 643 diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 75359855cfd5..796ff642a9e5 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -281,23 +281,15 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC { final HepProgramBuilder builder = HepProgram.builder(); builder.addMatchLimit(CalciteRulesManager.HEP_DEFAULT_MATCH_LIMIT); -// builder.addGroupBegin(); builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); -// builder.addGroupEnd(); - - builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); - builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); - -// builder.addGroupBegin(); builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); -// builder.addGroupEnd(); - - + builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); + builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); final HepProgramBuilder builder2 = HepProgram.builder(); builder2.addRuleInstance(new LogicalUnnestRule()); builder2.addRuleInstance(new UnnestInputCleanupRule()); @@ -305,15 +297,11 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder2.addRuleInstance(CoreRules.PROJECT_MERGE); builder2.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); return Programs.sequence( - new LoggingProgram("__decStart", true), Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), - new LoggingProgram("__decAfterBuild1", true), - new DruidTrimFieldsProgram(false), - new LoggingProgram("__decAfterTrim1", true), + new DruidTrimFieldsProgram(true), Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE), - new LoggingProgram("__decAfterBuild2", true), new DruidTrimFieldsProgram(false), - new LoggingProgram("__decAfterTrim2", true) + Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE) ); } @@ -569,7 +557,7 @@ public RelNode run( { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); final RelNode decorrelatedRel = RelDecorrelator.decorrelateQuery(rel, relBuilder); - return runFieldTrimmer(relBuilder, decorrelatedRel); + return runFieldTrimmer2(relBuilder, decorrelatedRel); } } From 12c82dd8d521e82174a9f9fde77776cf78e462c3 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 17:34:21 +0000 Subject: [PATCH 62/99] more w --- s | 22 ------------------- s2 | 22 ------------------- .../calcite/planner/DruidRelFieldTrimmer.java | 2 -- ...testUnnestExtractionFn@NullHandling=sql.iq | 12 +++++----- .../testUnnestWithGroupByHavingSelector.iq | 12 +++++----- ...ngWithWhereOnUnnestCol@NullHandling=sql.iq | 12 +++++----- ...tionsOfUnnestedColumns@NullHandling=sql.iq | 12 +++++----- ...iltersOnUnnestedColumn@NullHandling=sql.iq | 12 +++++----- 8 files changed, 30 insertions(+), 76 deletions(-) delete mode 100644 s delete mode 100644 s2 diff --git a/s b/s deleted file mode 100644 index c9145cd9fe67..000000000000 --- a/s +++ /dev/null @@ -1,22 +0,0 @@ -2024-12-04T16:38:13,926 INFO [main] org.apache.druid.sql.calcite.planner.CalciteRulesManager - __decAfterTrim1 -LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3]): rowcount = 3.75, cumulative cost = {inf}, id = 1092 - LogicalCorrelate(correlation=[$cor2], joinType=[inner], requiredColumns=[{0}]): rowcount = 3.75, cumulative cost = {inf}, id = 1091 - LogicalProject(arrayStringNulls=[$0], uln=[$2], udn=[$3]): rowcount = 3.75, cumulative cost = {inf}, id = 1085 - LogicalFilter(condition=[OR(=($2, 1), =($3, 2.2))]): rowcount = 3.75, cumulative cost = {inf}, id = 1084 - LogicalCorrelate(correlation=[$cor1], joinType=[inner], requiredColumns=[{1}]): rowcount = 15.0, cumulative cost = {inf}, id = 1083 - LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3]): rowcount = 15.0, cumulative cost = {inf}, id = 1079 - LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{1}]): rowcount = 15.0, cumulative cost = {inf}, id = 1078 - LogicalProject(arrayStringNulls=[$1], arrayLongNulls=[$2], arrayDoubleNulls=[$3]): rowcount = 15.0, cumulative cost = {230.0 rows, 646.0 cpu, 0.0 io}, id = 1074 - LogicalFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]): rowcount = 15.0, cumulative cost = {215.0 rows, 601.0 cpu, 0.0 io}, id = 1073 - LogicalProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]): rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id = 1072 - LogicalTableScan(table=[[druid, arrays]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 640 - Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1077 - LogicalProject(arrayLongNulls=[$cor0.arrayLongNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1076 - LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 641 - Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1082 - LogicalProject(arrayDoubleNulls=[$cor1.arrayDoubleNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1081 - LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 647 - LogicalFilter(condition=[=($0, 'a')]): rowcount = 1.0, cumulative cost = {4.0 rows, 4.0 cpu, 0.0 io}, id = 1090 - Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1089 - LogicalProject(arrayStringNulls=[$cor2.arrayStringNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1088 - LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 653 diff --git a/s2 b/s2 deleted file mode 100644 index 0aba204521b9..000000000000 --- a/s2 +++ /dev/null @@ -1,22 +0,0 @@ -2024-12-04T16:50:39,077 INFO [main] org.apache.druid.sql.calcite.planner.CalciteRulesManager - __decAfterTrim1 -LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3]): rowcount = 3.75, cumulative cost = {inf}, id = 1072 - LogicalCorrelate(correlation=[$cor2], joinType=[inner], requiredColumns=[{0}]): rowcount = 3.75, cumulative cost = {inf}, id = 1071 - LogicalProject(arrayStringNulls=[$0], uln=[$2], udn=[$3]): rowcount = 3.75, cumulative cost = {inf}, id = 1065 - LogicalFilter(condition=[OR(=($2, 1), =($3, 2.2))]): rowcount = 3.75, cumulative cost = {inf}, id = 1064 - LogicalCorrelate(correlation=[$cor1], joinType=[inner], requiredColumns=[{1}]): rowcount = 15.0, cumulative cost = {inf}, id = 1063 - LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3]): rowcount = 15.0, cumulative cost = {inf}, id = 1059 - LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{1}]): rowcount = 15.0, cumulative cost = {inf}, id = 1058 - LogicalProject(arrayStringNulls=[$1], arrayLongNulls=[$2], arrayDoubleNulls=[$3]): rowcount = 15.0, cumulative cost = {230.0 rows, 646.0 cpu, 0.0 io}, id = 1054 - LogicalFilter(condition=[=($0, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]): rowcount = 15.0, cumulative cost = {215.0 rows, 601.0 cpu, 0.0 io}, id = 1053 - LogicalProject(arrayString=[$1], arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]): rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id = 1052 - LogicalTableScan(table=[[druid, arrays]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 630 - Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1057 - LogicalProject(arrayLongNulls=[$cor0.arrayLongNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1056 - LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 631 - Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1062 - LogicalProject(arrayDoubleNulls=[$cor1.arrayDoubleNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1061 - LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 637 - LogicalFilter(condition=[=($0, 'a')]): rowcount = 1.0, cumulative cost = {4.0 rows, 4.0 cpu, 0.0 io}, id = 1070 - Uncollect: rowcount = 1.0, cumulative cost = {3.0 rows, 3.0 cpu, 0.0 io}, id = 1069 - LogicalProject(arrayStringNulls=[$cor2.arrayStringNulls]): rowcount = 1.0, cumulative cost = {2.0 rows, 2.0 cpu, 0.0 io}, id = 1068 - LogicalValues(tuples=[[{ 0 }]]): rowcount = 1.0, cumulative cost = {1.0 rows, 1.0 cpu, 0.0 io}, id = 643 diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 5c6b21a2e2b6..5982aefb3a33 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -122,7 +122,6 @@ public TrimResult trimFields(LogicalCorrelate correlate, List newInputs = new ArrayList<>(); List inputMappings = new ArrayList<>(); - @Deprecated int changeCount = 0; int offset = 0; for (RelNode input : correlate.getInputs()) { @@ -199,7 +198,6 @@ public TrimResult trimFields(LogicalUnnest correlate, // Create input with trimmed columns. TrimResult trimResult = trimChild(correlate, input, inputFieldsUsed, extraFields); - RelNode newInput = trimResult.left; final Mapping inputMapping = trimResult.right; diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq index ab1155737d5a..902a04237d77 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestExtractionFn@NullHandling=sql.iq @@ -20,15 +20,15 @@ SELECT substring(d3,1) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (3 rows) !ok -LogicalProject(EXPR$0=[SUBSTRING($2, 1)]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[<>(SUBSTRING($0, 1), 'b')]) - LogicalProject(__time=[$0], dim3=[$3]) +LogicalProject(EXPR$0=[SUBSTRING($1, 1)]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>(SUBSTRING($0, 1), 'b')]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(EXPR$0=[SUBSTRING($2, 1)], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[<>(SUBSTRING($0, 1), 'b')]) - DruidProject(__time=[$0], dim3=[$3], druid=[logical]) +DruidProject(EXPR$0=[SUBSTRING($1, 1)], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>(SUBSTRING($0, 1), 'b')]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq index 1b669dbde152..26485b8d1e42 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq @@ -18,15 +18,15 @@ SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) (1 row) !ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'b')]) - LogicalProject(__time=[$0], dim3=[$3]) +LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'b')]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'b')]) - DruidProject(__time=[$0], dim3=[$3], druid=[logical]) +DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'b')]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq index ac65b537c651..f89bd0a3e8ca 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq @@ -18,15 +18,15 @@ SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) (1 row) !ok -LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'a')]) - LogicalProject(__time=[$0], dim3=[$3]) +LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'a')]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[=($0, 'a')]) - DruidProject(__time=[$0], dim3=[$3], druid=[logical]) +DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'a')]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq index bd6baaf3a5ac..40527edea4c4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithMultipleOrFiltersOnVariationsOfUnnestedColumns@NullHandling=sql.iq @@ -23,15 +23,15 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where st (6 rows) !ok -LogicalProject(d3=[$2]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - LogicalProject(__time=[$0], dim3=[$3]) +LogicalProject(d3=[$1]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(d3=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) - DruidProject(__time=[$0], dim3=[$3], druid=[logical]) +DruidProject(d3=[$1], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[OR(<(STRLEN($0), 2), =($0, 'd'))]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq index 5010184f669d..c2337e90168a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithNotFiltersOnUnnestedColumn@NullHandling=sql.iq @@ -22,15 +22,15 @@ SELECT d3 FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) where d3 (5 rows) !ok -LogicalProject(d3=[$2]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[<>($0, 'd')]) - LogicalProject(__time=[$0], dim3=[$3]) +LogicalProject(d3=[$1]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>($0, 'd')]) + LogicalProject(dim3=[$3]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(d3=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)], filter=[<>($0, 'd')]) - DruidProject(__time=[$0], dim3=[$3], druid=[logical]) +DruidProject(d3=[$1], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[<>($0, 'd')]) + DruidProject(dim3=[$3], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan From 7bb3d7a17f229137dd133cee4855f8b9582d657f Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 17:42:37 +0000 Subject: [PATCH 63/99] convert early --- .../apache/druid/sql/calcite/planner/CalciteRulesManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 796ff642a9e5..e2ac70f236c6 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -291,8 +291,8 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); final HepProgramBuilder builder2 = HepProgram.builder(); - builder2.addRuleInstance(new LogicalUnnestRule()); - builder2.addRuleInstance(new UnnestInputCleanupRule()); + builder.addRuleInstance(new LogicalUnnestRule()); + builder.addRuleInstance(new UnnestInputCleanupRule()); builder2.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); builder2.addRuleInstance(CoreRules.PROJECT_MERGE); builder2.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); From f584ab059701d7291af8a953398417a6e36faf94 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 17:46:34 +0000 Subject: [PATCH 64/99] convert early --- .../apache/druid/sql/calcite/planner/CalciteRulesManager.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index e2ac70f236c6..b989dcda42f3 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -290,6 +290,7 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); + builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); final HepProgramBuilder builder2 = HepProgram.builder(); builder.addRuleInstance(new LogicalUnnestRule()); builder.addRuleInstance(new UnnestInputCleanupRule()); @@ -298,8 +299,6 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder2.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(true), - Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE), new DruidTrimFieldsProgram(false), Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE) ); From 627f4a80d99abbb37fcc3fbb3c54bce9442e5421 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 4 Dec 2024 17:52:07 +0000 Subject: [PATCH 65/99] up --- .../apache/druid/sql/calcite/planner/CalciteRulesManager.java | 2 +- .../testGroupByWithLiteralInSubqueryGrouping.iq | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index b989dcda42f3..bfe1146290c3 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -299,7 +299,7 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder2.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(false), + new DruidTrimFieldsProgram(true), Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE) ); } diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq index da905b0336c1..65cce7cc14b4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq @@ -30,8 +30,8 @@ SELECT +-------+----+ | t1 | t2 | +-------+----+ -| dummy | | | dummy | b | +| dummy | | +-------+----+ (2 rows) From b7dcbf6e8c76d7556c6bf0e1012a77f45d30bc06 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 5 Dec 2024 09:56:21 +0000 Subject: [PATCH 66/99] cleanup --- .../druid/sql/calcite/planner/CalciteRulesManager.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index bfe1146290c3..d72c81eb8dd4 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -284,16 +284,13 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder.addRuleCollection(baseRuleSet(plannerContext)); builder.addRuleInstance(CoreRules.UNION_MERGE); builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); - builder.addRuleCollection(baseRuleSet(plannerContext)); - builder.addRuleInstance(CoreRules.UNION_MERGE); - builder.addRuleInstance(FilterCorrelateRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); builder.addRuleInstance(JoinExtractFilterRule.Config.DEFAULT.toRule()); builder.addRuleInstance(FilterIntoJoinRuleConfig.DEFAULT.withPredicate(DruidJoinRule::isSupportedPredicate).toRule()); builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); - final HepProgramBuilder builder2 = HepProgram.builder(); builder.addRuleInstance(new LogicalUnnestRule()); builder.addRuleInstance(new UnnestInputCleanupRule()); + final HepProgramBuilder builder2 = HepProgram.builder(); builder2.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); builder2.addRuleInstance(CoreRules.PROJECT_MERGE); builder2.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); From e72d54b4a2bf7fab3ae66ab4532457a5b9d86f65 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 5 Dec 2024 09:59:57 +0000 Subject: [PATCH 67/99] cleanup --- .../calcite/planner/CalciteRulesManager.java | 45 +++++++------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index d72c81eb8dd4..cc7caeade632 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -48,7 +48,6 @@ import org.apache.calcite.sql.SqlExplainFormat; import org.apache.calcite.sql.SqlExplainLevel; import org.apache.calcite.sql2rel.RelDecorrelator; -import org.apache.calcite.sql2rel.RelFieldTrimmer; import org.apache.calcite.tools.Program; import org.apache.calcite.tools.Programs; import org.apache.calcite.tools.RelBuilder; @@ -290,14 +289,15 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC builder.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); builder.addRuleInstance(new LogicalUnnestRule()); builder.addRuleInstance(new UnnestInputCleanupRule()); - final HepProgramBuilder builder2 = HepProgram.builder(); - builder2.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); - builder2.addRuleInstance(CoreRules.PROJECT_MERGE); - builder2.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); + + final HepProgramBuilder cleanupRules = HepProgram.builder(); + cleanupRules.addRuleInstance(FilterProjectTransposeRule.Config.DEFAULT.toRule()); + cleanupRules.addRuleInstance(CoreRules.PROJECT_MERGE); + cleanupRules.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), new DruidTrimFieldsProgram(true), - Programs.of(builder2.build(), true, DefaultRelMetadataProvider.INSTANCE) + Programs.of(cleanupRules.build(), true, DefaultRelMetadataProvider.INSTANCE) ); } @@ -553,13 +553,15 @@ public RelNode run( { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); final RelNode decorrelatedRel = RelDecorrelator.decorrelateQuery(rel, relBuilder); - return runFieldTrimmer2(relBuilder, decorrelatedRel); + RelNode ret = new DruidRelFieldTrimmer(null, relBuilder, true).trim(decorrelatedRel); + return ret; } } /** Program that trims fields. */ - private static class DruidTrimFieldsProgram implements Program { + private static class DruidTrimFieldsProgram implements Program + { private boolean trim; public DruidTrimFieldsProgram(boolean trim) @@ -567,32 +569,15 @@ public DruidTrimFieldsProgram(boolean trim) this.trim = trim; } - @Override public RelNode run(RelOptPlanner planner, RelNode rel, + @Override + public RelNode run(RelOptPlanner planner, RelNode rel, RelTraitSet requiredOutputTraits, List materializations, - List lattices) { - final RelBuilder relBuilder = - RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); + List lattices) + { + final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); RelNode ret = new DruidRelFieldTrimmer(null, relBuilder, trim).trim(rel); return ret; } } - - private static RelNode runFieldTrimmer2(RelBuilder relBuilder, RelNode decorrelatedRel) - { - RelNode a = new RelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); - a=decorrelatedRel; - return runFieldTrimmer(relBuilder, a); - } - - - private static RelNode runFieldTrimmer(final RelBuilder relBuilder, final RelNode decorrelatedRel) - { - if(true) { - return new DruidRelFieldTrimmer(null, relBuilder,true).trim(decorrelatedRel); - } else { - return new RelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); - } - } - } From 1fd2addc6e9d84faa292ddf7ea5b61f74545537f Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 5 Dec 2024 10:03:22 +0000 Subject: [PATCH 68/99] cleanup --- .../org/apache/druid/sql/calcite/rule/logical/Unnest.java | 2 +- .../sql/calcite/rule/logical/UnnestInputCleanupRule.java | 7 ++----- .../apache/druid/sql/calcite/CalciteArraysQueryTest.java | 5 ----- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java index 21c3f9520612..77b82e1c8170 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/Unnest.java @@ -50,7 +50,7 @@ protected Unnest(RelOptCluster cluster, RelTraitSet traits, RelNode input, RexNo @Override protected RelDataType deriveRowType() { - List fields =new ArrayList<>(); + List fields = new ArrayList<>(); fields.addAll(input.getRowType().getFieldList()); fields.add(unnestFieldType); return new RelRecordType(fields); diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index e611f3a6e2b0..a699c926e737 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -85,12 +85,12 @@ public void onMatch(RelOptRuleCall call) RexNode newUnnestExpr = unnestInput.accept(new ExpressionPullerRexShuttle(newProjects, inputIndex)); - if(newUnnestExpr instanceof RexInputRef) { + if (newUnnestExpr instanceof RexInputRef) { // this won't make it simpler return; } - if(newProjects.get(inputIndex) == null ) { + if (newProjects.get(inputIndex) == null) { newProjects.set( inputIndex, rexBuilder.makeInputRef(oldProject.getInput(), 0) @@ -118,9 +118,6 @@ public void onMatch(RelOptRuleCall call) // not-anymore referenced input columns beneath oldProject List projectFields = new ArrayList<>(builder.fields()); int hideCount = newProjects.size() - oldProject.getProjects().size(); - if(hideCount>0) { -// return; - } for (int i = 0; i < hideCount; i++) { projectFields.remove(unnest.getRowType().getFieldCount() - 2); } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 395492c9e214..9c8f5beac5d7 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -5310,7 +5310,6 @@ public void testUnnestVirtualWithColumns2() ); } -// @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) @Test public void testUnnestWithFilters() { @@ -5460,7 +5459,6 @@ public void testUnnestWithFiltersInnerLimit() ); } -// @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) @Test public void testUnnestWithFiltersInsideAndOutside() { @@ -5498,7 +5496,6 @@ public void testUnnestWithFiltersInsideAndOutside() ); } -// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestWithFiltersInsideAndOutside1() { @@ -5539,7 +5536,6 @@ public void testUnnestWithFiltersInsideAndOutside1() ); } -// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestWithFiltersOutside() { @@ -6769,7 +6765,6 @@ public void testUnnestWithTimeFilterOnlyArrayColumn() ); } -// @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestWithTimeFilterAndAnotherFilter() { From 844b1f28f645ac90ea3eecaec636e7fef0399f09 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 5 Dec 2024 10:07:18 +0000 Subject: [PATCH 69/99] remove tmp tests --- .../sql/calcite/CalciteArraysQueryTest.java | 92 ------------------- 1 file changed, 92 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 9c8f5beac5d7..3012575b7b35 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -6875,98 +6875,6 @@ public void testUnnestWithTimeFilterOnlyNested() ); } - public void testQuery1( - final String sql, - final Map queryContext, - final List> expectedQueries, - final List expectedResults - ) - { - testBuilder() - .queryContext(queryContext) - .sql(sql) - .expectedQueries(expectedQueries) - .expectedResults(expectedResults) - .run(); - } - - - @Test - public void testUnnestWithTimeFilterOnlyNestedIsBad0() - { - testQuery1( - "select d,c from foo CROSS JOIN UNNEST(ARRAY[m1,m2]) as un(d) CROSS JOIN unnest(MV_TO_ARRAY(dim3)) as u(c)" - + " where __time >= TIMESTAMP '2000-01-02 00:00:00' and __time <= TIMESTAMP '2000-01-03 00:10:00'", - QUERY_CONTEXT_UNNEST, - ImmutableList.of( - Druids.newScanQueryBuilder() - .dataSource(UnnestDataSource.create( - UnnestDataSource.create( - FilteredDataSource.create( - new TableDataSource(CalciteTests.DATASOURCE1), - range("__time", ColumnType.LONG, 946771200000L, 946858200000L, false, false) - ), - expressionVirtualColumn("j0.unnest", "array(\"m1\",\"m2\")", ColumnType.FLOAT_ARRAY), - null - ), - nestedExpressionVirtualColumn("_j0.unnest", "\"dim3\"", ColumnType.STRING), - null - )) - .intervals(querySegmentSpec(Intervals.of("2000-01-02T00:00:00.000Z/2000-01-03T00:10:00.001Z"))) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(QUERY_CONTEXT_UNNEST) - .columns(ImmutableList.of("j0.unnest", "_j0.unnest")) - .columnTypes(ColumnType.FLOAT, ColumnType.STRING) - .build() - ), - ImmutableList.of( - new Object[]{2.0F, "b"}, - new Object[]{2.0F, "c"}, - new Object[]{2.0F, "b"}, - new Object[]{2.0F, "c"}, - new Object[]{3.0F, "d"}, - new Object[]{3.0F, "d"} ) - ); - } - - @Test - public void testUnnestWithTimeFilterOnlyNestedIsBad() - { - testQuery1( - "select d from foo CROSS JOIN UNNEST(ARRAY[m1,m2]) as un(d) CROSS JOIN unnest(MV_TO_ARRAY(dim3)) as u(c)" - + " where __time >= TIMESTAMP '2000-01-02 00:00:00' and __time <= TIMESTAMP '2000-01-03 00:10:00'", - QUERY_CONTEXT_UNNEST, - ImmutableList.of( - Druids.newScanQueryBuilder() - .dataSource(UnnestDataSource.create( - UnnestDataSource.create( - FilteredDataSource.create( - new TableDataSource(CalciteTests.DATASOURCE1), - range("__time", ColumnType.LONG, 946771200000L, 946858200000L, false, false) - ), - expressionVirtualColumn("j0.unnest", "array(\"m1\",\"m2\")", ColumnType.FLOAT_ARRAY), - null - ), - nestedExpressionVirtualColumn("_j0.unnest", "\"dim3\"", ColumnType.STRING), - null - )) - .intervals(querySegmentSpec(Intervals.of("2000-01-02T00:00:00.000Z/2000-01-03T00:10:00.001Z"))) - .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST) - .context(QUERY_CONTEXT_UNNEST) - .columns(ImmutableList.of("j0.unnest")) - .columnTypes(ColumnType.FLOAT) - .build() - ), - ImmutableList.of( - new Object[]{2.0F}, - new Object[]{2.0F}, - new Object[]{2.0F}, - new Object[]{2.0F}, - new Object[]{3.0F}, - new Object[]{3.0F}) - ); - } - @Test public void testUnnestWithTimeFilterOnlyNestedAndNestedAgain() { From c024d1e564daa8337d530f253c7bc8b5adf7660d Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 5 Dec 2024 12:49:33 +0000 Subject: [PATCH 70/99] indent --- .../sql/calcite/rule/logical/UnnestInputCleanupRule.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java index a699c926e737..6b3e7aac5ac9 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/UnnestInputCleanupRule.java @@ -126,7 +126,7 @@ public void onMatch(RelOptRuleCall call) inputIndex, newUnnestExpr ); - builder.project(projectFields, ImmutableSet.of() , true); + builder.project(projectFields, ImmutableSet.of(), true); RelNode build = builder.build(); call.transformTo(build); @@ -152,8 +152,8 @@ public RexNode visitInputRef(RexInputRef inputRef) { int newIndex = projects.indexOf(inputRef); if (newIndex < 0) { - newIndex = projects.size(); - projects.add(inputRef); + newIndex = projects.size(); + projects.add(inputRef); } if (newIndex == inputRef.getIndex()) { return inputRef; From 928637dc49f4f9756318cd628380926cc66bfd76 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 5 Dec 2024 12:51:45 +0000 Subject: [PATCH 71/99] add --- ...olumnsArrayColumns@NullHandling=default.iq | 274 ++++++++++++++++++ ...ayColumnsOrFilters@NullHandling=default.iq | 132 +++++++++ ...umnsORCombinations@NullHandling=default.iq | 134 +++++++++ ...reOnUnnestArrayCol@NullHandling=default.iq | 74 +++++ ...thWhereOnUnnestCol@NullHandling=default.iq | 74 +++++ 5 files changed, 688 insertions(+) create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=default.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=default.iq diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq new file mode 100644 index 000000000000..41ab9a29c26b --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq @@ -0,0 +1,274 @@ +# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default case-crc:84cffaf8 +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// + SELECT arrayString, uln, udn, usn FROM + ( SELECT * FROM + ( SELECT * FROM arrays, UNNEST(arrayLongNulls) as ut(uln)) ,UNNEST(arrayDoubleNulls) as ut(udn) + ), UNNEST(arrayStringNulls) as ut(usn) WHERE arrayString = ARRAY['a','b'] AND uln = 1 AND udn = 2.2 AND usn = 'a'; +org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : Error while executing SQL " SELECT arrayString, uln, udn, usn FROM + ( SELECT * FROM + ( SELECT * FROM arrays, UNNEST(arrayLongNulls) as ut(uln)) ,UNNEST(arrayDoubleNulls) as ut(udn) + ), UNNEST(arrayStringNulls) as ut(usn) WHERE arrayString = ARRAY['a','b'] AND uln = 1 AND udn = 2.2 AND usn = 'a'": Remote driver error: UOE: Predicate does not support ARRAY types + at org.apache.calcite.avatica.Helper.createException(Helper.java:54) + at org.apache.calcite.avatica.Helper.createException(Helper.java:41) + at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:164) + at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:228) + at net.hydromatic.quidem.Quidem.checkResult(Quidem.java:299) + at net.hydromatic.quidem.Quidem.access$2600(Quidem.java:57) + at net.hydromatic.quidem.Quidem$ContextImpl.checkResult(Quidem.java:1636) + at net.hydromatic.quidem.Quidem$CheckResultCommand.execute(Quidem.java:941) + at net.hydromatic.quidem.Quidem$CompositeCommand.execute(Quidem.java:1437) + at net.hydromatic.quidem.Quidem.execute(Quidem.java:190) + at org.apache.druid.quidem.DruidQuidemTestBase$DruidQuidemRunner.run(DruidQuidemTestBase.java:158) + at org.apache.druid.quidem.DruidQuidemTestBase$DruidQuidemRunner.run(DruidQuidemTestBase.java:138) + at org.apache.druid.sql.calcite.QTestCase$1.run(QTestCase.java:73) + at org.apache.druid.sql.calcite.QueryTestRunner.run(QueryTestRunner.java:768) + at org.apache.druid.sql.calcite.QueryTestBuilder.run(QueryTestBuilder.java:304) + at org.apache.druid.sql.calcite.BaseCalciteQueryTest.testQuery(BaseCalciteQueryTest.java:780) + at org.apache.druid.sql.calcite.CalciteArraysQueryTest.testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns(CalciteArraysQueryTest.java:4816) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:728) + at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) + at org.apache.druid.sql.calcite.NotYetSupported$NotYetSupportedProcessor.interceptTestMethod(NotYetSupported.java:131) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) + at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156) + at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147) + at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86) + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:218) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:214) + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:139) + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) + at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) + at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) + at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) + at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) + at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) + at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types + at org.apache.druid.query.filter.DruidPredicateFactory.makeArrayPredicate(DruidPredicateFactory.java:42) + at org.apache.druid.segment.filter.PredicateValueMatcherFactory.makeArrayProcessor(PredicateValueMatcherFactory.java:110) + at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:90) + at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:39) + at org.apache.druid.segment.ColumnProcessors.makeProcessorInternal(ColumnProcessors.java:290) + at org.apache.druid.segment.ColumnProcessors.makeProcessor(ColumnProcessors.java:77) + at org.apache.druid.segment.filter.SelectorFilter.makeMatcher(SelectorFilter.java:115) + at org.apache.druid.segment.join.PostJoinCursor.(PostJoinCursor.java:56) + at org.apache.druid.segment.join.PostJoinCursor.wrap(PostJoinCursor.java:67) + at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:130) + at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:105) + at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:105) + at org.apache.druid.query.scan.ScanQueryEngine$1.make(ScanQueryEngine.java:143) + at org.apache.druid.java.util.common.guava.BaseSequence.toYielder(BaseSequence.java:66) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.query.spec.SpecificSegmentQueryRunner$1.toYielder(SpecificSegmentQueryRunner.java:113) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.query.spec.SpecificSegmentQueryRunner.doNamed(SpecificSegmentQueryRunner.java:185) + at org.apache.druid.query.spec.SpecificSegmentQueryRunner$2.wrap(SpecificSegmentQueryRunner.java:165) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.java.util.common.guava.ConcatSequence.makeYielder(ConcatSequence.java:85) + at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:65) + at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) + at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) + at org.apache.druid.java.util.common.guava.LazySequence.toYielder(LazySequence.java:46) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.java.util.common.guava.MergeSequence.lambda$toYielder$0(MergeSequence.java:66) + at org.apache.druid.java.util.common.guava.BaseSequence.accumulate(BaseSequence.java:44) + at org.apache.druid.java.util.common.guava.MergeSequence.toYielder(MergeSequence.java:63) + at org.apache.druid.query.RetryQueryRunner$1.toYielder(RetryQueryRunner.java:133) + at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.query.CPUTimeMetricQueryRunner$1.wrap(CPUTimeMetricQueryRunner.java:77) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) + at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:51) + at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) + at org.apache.druid.java.util.common.guava.Yielders.each(Yielders.java:32) + at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$execute$0(DruidJdbcResultSet.java:239) + at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) + at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) + at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) + at java.base/java.lang.Thread.run(Thread.java:829) + +!ok +LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[1:BIGINT], udn=[$1], usn=[$2]) + LogicalUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) + LogicalProject(arrayStringNulls=[$0], udn=[$2]) + LogicalUnnest(unnestExpr=[$1], filter=[=($0, 2.2)]) + LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2]) + LogicalUnnest(unnestExpr=[$1], filter=[=($0, 1)]) + LogicalProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) + LogicalFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + LogicalTableScan(table=[[druid, arrays]]) + +!logicalPlan +DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[1:BIGINT], udn=[$1], usn=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) + DruidProject(arrayStringNulls=[$0], udn=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[$1], filter=[=($0, 2.2)]) + DruidProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], druid=[logical]) + DruidUnnest(unnestExpr=[$1], filter=[=($0, 1)]) + DruidProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) + DruidFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "unnest", + "base" : { + "type" : "unnest", + "base" : { + "type" : "filter", + "base" : { + "type" : "table", + "name" : "arrays" + }, + "filter" : { + "type" : "expression", + "expression" : "(\"arrayString\" == array('a','b'))" + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "\"arrayLongNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "1" + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "\"arrayDoubleNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "2.2" + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "_j0.unnest", + "expression" : "\"arrayStringNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "selector", + "dimension" : "_j0.unnest", + "value" : "a" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "array('a','b')", + "outputType" : "ARRAY" + }, { + "type" : "expression", + "name" : "v1", + "expression" : "1", + "outputType" : "LONG" + } ], + "resultFormat" : "compactedList", + "columns" : [ "v0", "v1", "j0.unnest", "_j0.unnest" ], + "columnTypes" : [ "ARRAY", "LONG", "DOUBLE", "STRING" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq new file mode 100644 index 000000000000..f604252db9a4 --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq @@ -0,0 +1,132 @@ +# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default case-crc:8bc6fb6b +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// + SELECT arrayString, uln, udn, usn FROM + ( SELECT * FROM + ( SELECT * FROM arrays, UNNEST(arrayLongNulls) as ut(uln)) ,UNNEST(arrayDoubleNulls) as ut(udn) + ), UNNEST(arrayStringNulls) as ut(usn) WHERE arrayString = ARRAY['a','b'] AND (uln = 1 OR udn = 2.2) AND usn = 'a'; ++-------------+-----+-----+-----+ +| arrayString | uln | udn | usn | ++-------------+-----+-----+-----+ +| [a, b] | 1 | 1.1 | a | +| [a, b] | 1 | 2.2 | a | +| [a, b] | 1 | | a | +| [a, b] | 3 | 2.2 | a | +| [a, b] | | 2.2 | a | ++-------------+-----+-----+-----+ +(5 rows) + +!ok +LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3]) + LogicalUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) + LogicalProject(arrayStringNulls=[$0], uln=[$2], udn=[$3]) + LogicalFilter(condition=[OR(=($2, 1), =($3, 2.2))]) + LogicalUnnest(unnestExpr=[$1]) + LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3]) + LogicalUnnest(unnestExpr=[$1]) + LogicalProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) + LogicalFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + LogicalTableScan(table=[[druid, arrays]]) + +!logicalPlan +DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) + DruidProject(arrayStringNulls=[$0], uln=[$2], udn=[$3], druid=[logical]) + DruidFilter(condition=[OR(=($2, 1), =($3, 2.2))]) + DruidUnnest(unnestExpr=[$1]) + DruidProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[$1]) + DruidProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) + DruidFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "filter", + "base" : { + "type" : "unnest", + "base" : { + "type" : "unnest", + "base" : { + "type" : "filter", + "base" : { + "type" : "table", + "name" : "arrays" + }, + "filter" : { + "type" : "expression", + "expression" : "(\"arrayString\" == array('a','b'))" + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "\"arrayLongNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : null + }, + "virtualColumn" : { + "type" : "expression", + "name" : "_j0.unnest", + "expression" : "\"arrayDoubleNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : null + }, + "filter" : { + "type" : "or", + "fields" : [ { + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "1" + }, { + "type" : "selector", + "dimension" : "_j0.unnest", + "value" : "2.2" + } ] + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "__j0.unnest", + "expression" : "\"arrayStringNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "selector", + "dimension" : "__j0.unnest", + "value" : "a" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "array('a','b')", + "outputType" : "ARRAY" + } ], + "resultFormat" : "compactedList", + "columns" : [ "v0", "j0.unnest", "_j0.unnest", "__j0.unnest" ], + "columnTypes" : [ "ARRAY", "LONG", "DOUBLE", "STRING" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=default.iq new file mode 100644 index 000000000000..ee9c01b7132b --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=default.iq @@ -0,0 +1,134 @@ +# testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=default case-crc:b18b7dbe +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// + SELECT dimZipf, dim3_unnest1, dim3_unnest2, dim3_unnest3 FROM + ( SELECT * FROM + ( SELECT * FROM lotsocolumns, UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest1) ) ,UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest2) + ), UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest3) WHERE dimZipf=27 AND (dim3_unnest1='Baz' OR dim3_unnest2='Hello') AND dim3_unnest3='World'; ++---------+--------------+--------------+--------------+ +| dimZipf | dim3_unnest1 | dim3_unnest2 | dim3_unnest3 | ++---------+--------------+--------------+--------------+ +| 27 | Baz | Baz | World | +| 27 | Baz | Baz | World | +| 27 | Baz | Baz | World | +| 27 | Baz | Baz | World | +| 27 | Baz | Hello | World | +| 27 | Baz | Hello | World | +| 27 | Baz | World | World | +| 27 | Baz | World | World | +| 27 | Hello | Hello | World | +| 27 | World | Hello | World | ++---------+--------------+--------------+--------------+ +(10 rows) + +!ok +LogicalProject(dimZipf=[$0], dim3_unnest1=[$1], dim3_unnest2=[$2], dim3_unnest3=[$4]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[=($0, 'World')]) + LogicalProject(dimZipf=[$1], dim3_unnest1=[$2], EXPR$0=[$3], dimMultivalEnumerated0=[$0]) + LogicalFilter(condition=[OR(=($2, 'Baz'), =($3, 'Hello'))]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + LogicalProject(dimMultivalEnumerated=[$2], dimZipf=[$8]) + LogicalFilter(condition=[=(CAST($8):INTEGER, 27)]) + LogicalTableScan(table=[[druid, lotsocolumns]]) + +!logicalPlan +DruidProject(dimZipf=[$0], dim3_unnest1=[$1], dim3_unnest2=[$2], dim3_unnest3=[$4], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[=($0, 'World')]) + DruidProject(dimZipf=[$1], dim3_unnest1=[$2], EXPR$0=[$3], dimMultivalEnumerated0=[$0], druid=[logical]) + DruidFilter(condition=[OR(=($2, 'Baz'), =($3, 'Hello'))]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + DruidProject(dimMultivalEnumerated=[$2], dimZipf=[$8], druid=[logical]) + DruidFilter(condition=[=(CAST($8):INTEGER, 27)]) + DruidTableScan(table=[[druid, lotsocolumns]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "filter", + "base" : { + "type" : "unnest", + "base" : { + "type" : "unnest", + "base" : { + "type" : "filter", + "base" : { + "type" : "table", + "name" : "lotsocolumns" + }, + "filter" : { + "type" : "bound", + "dimension" : "dimZipf", + "lower" : "27", + "upper" : "27", + "ordering" : { + "type" : "numeric" + } + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "mv_to_array(\"dimMultivalEnumerated\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : null + }, + "virtualColumn" : { + "type" : "expression", + "name" : "_j0.unnest", + "expression" : "mv_to_array(\"dimMultivalEnumerated\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : null + }, + "filter" : { + "type" : "or", + "fields" : [ { + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "Baz" + }, { + "type" : "selector", + "dimension" : "_j0.unnest", + "value" : "Hello" + } ] + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "__j0.unnest", + "expression" : "mv_to_array(\"dimMultivalEnumerated\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "selector", + "dimension" : "__j0.unnest", + "value" : "World" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "resultFormat" : "compactedList", + "columns" : [ "dimZipf", "j0.unnest", "_j0.unnest", "__j0.unnest" ], + "columnTypes" : [ "STRING", "STRING", "STRING", "STRING" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq new file mode 100644 index 000000000000..e46f6bef54b0 --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq @@ -0,0 +1,74 @@ +# testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default case-crc:33b6333c +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// +SELECT uln, COUNT(*) FROM druid.arrays, UNNEST(arrayLongNulls) AS unnested(uln) WHERE uln IN (1, 2, 3) GROUP BY uln HAVING uln=1; ++-----+--------+ +| uln | EXPR$1 | ++-----+--------+ +| 1 | 5 | ++-----+--------+ +(1 row) + +!ok +LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) + LogicalUnnest(unnestExpr=[$0], filter=[=($0, 1)]) + LogicalProject(arrayLongNulls=[$4]) + LogicalTableScan(table=[[druid, arrays]]) + +!logicalPlan +DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) + DruidUnnest(unnestExpr=[$0], filter=[=($0, 1)]) + DruidProject(arrayLongNulls=[$4], druid=[logical]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) + +!druidPlan +{ + "queryType" : "groupBy", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "table", + "name" : "arrays" + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "\"arrayLongNulls\"", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "1" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "granularity" : { + "type" : "all" + }, + "dimensions" : [ { + "type" : "default", + "dimension" : "j0.unnest", + "outputName" : "d0", + "outputType" : "LONG" + } ], + "aggregations" : [ { + "type" : "count", + "name" : "a0" + } ], + "limitSpec" : { + "type" : "NoopLimitSpec" + } +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=default.iq new file mode 100644 index 000000000000..7fa34f5673a4 --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=default.iq @@ -0,0 +1,74 @@ +# testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=default case-crc:a97b58b2 +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// +SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) WHERE d3 IN ('a','c') GROUP BY d3 HAVING d3='a'; ++----+--------+ +| d3 | EXPR$1 | ++----+--------+ +| a | 1 | ++----+--------+ +(1 row) + +!ok +LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'a')]) + LogicalProject(dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) + +!logicalPlan +DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'a')]) + DruidProject(dim3=[$3], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + +!druidPlan +{ + "queryType" : "groupBy", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "table", + "name" : "numfoo" + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "mv_to_array(\"dim3\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "a" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "granularity" : { + "type" : "all" + }, + "dimensions" : [ { + "type" : "default", + "dimension" : "j0.unnest", + "outputName" : "d0", + "outputType" : "STRING" + } ], + "aggregations" : [ { + "type" : "count", + "name" : "a0" + } ], + "limitSpec" : { + "type" : "NoopLimitSpec" + } +} +!nativePlan From e195135452bc3fa1493aad72c3b7ec5d125219b7 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Sat, 7 Dec 2024 15:59:10 +0000 Subject: [PATCH 72/99] try to fix unnest outputColumn --- .../apache/druid/query/UnnestDataSource.java | 39 +++++- .../druid/segment/UnnestCursorFactory.java | 45 ++++++- .../apache/druid/segment/UnnestSegment.java | 7 +- .../segment/UnnestCursorFactoryTest.java | 2 + .../sql/calcite/rule/logical/DruidUnnest.java | 12 +- .../sql/calcite/CalciteArraysQueryTest.java | 1 - .../sql/calcite/DecoupledTestConfig.java | 2 +- ...olumnsArrayColumns@NullHandling=default.iq | 51 ++++---- ...essionInInnerQuery@NullHandling=default.iq | 12 +- .../testUnnestWithGroupByHavingSelector.iq | 7 +- ...essionInInnerQuery@NullHandling=default.iq | 12 +- ...ndOtherAggregators@NullHandling=default.iq | 10 +- ...PushdownExtraction@NullHandling=default.iq | 14 +-- ...estGroupByWithLiteralInSubqueryGrouping.iq | 2 +- ...gregatorsUsingJoin@NullHandling=default.iq | 30 ++--- ...smatchWithLiterals@NullHandling=default.iq | 110 ----------------- ...peMismatchWithLiterals@NullHandling=sql.iq | 111 ------------------ ...meFilterOnSubquery@NullHandling=default.iq | 92 --------------- ...stTimeFilterOnSubquery@NullHandling=sql.iq | 88 -------------- ...ingWithScanAndSort@NullHandling=default.iq | 10 +- 20 files changed, 155 insertions(+), 502 deletions(-) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq diff --git a/processing/src/main/java/org/apache/druid/query/UnnestDataSource.java b/processing/src/main/java/org/apache/druid/query/UnnestDataSource.java index 06acca13a754..5454486398fe 100644 --- a/processing/src/main/java/org/apache/druid/query/UnnestDataSource.java +++ b/processing/src/main/java/org/apache/druid/query/UnnestDataSource.java @@ -20,6 +20,8 @@ package org.apache.druid.query; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import org.apache.druid.java.util.common.IAE; @@ -31,6 +33,7 @@ import org.apache.druid.utils.JvmUtils; import javax.annotation.Nullable; + import java.util.List; import java.util.Objects; import java.util.Set; @@ -49,6 +52,8 @@ public class UnnestDataSource implements DataSource { private final DataSource base; private final VirtualColumn virtualColumn; + @Nullable + private final String outputName; @Nullable private final DimFilter unnestFilter; @@ -56,15 +61,29 @@ public class UnnestDataSource implements DataSource private UnnestDataSource( DataSource dataSource, VirtualColumn virtualColumn, - DimFilter unnestFilter - ) + DimFilter unnestFilter, + @Nullable String outputName) { this.base = dataSource; this.virtualColumn = virtualColumn; this.unnestFilter = unnestFilter; + this.outputName = outputName; } @JsonCreator + public static UnnestDataSource create( + @JsonProperty("base") DataSource base, + @JsonProperty("virtualColumn") VirtualColumn virtualColumn, + @Nullable @JsonProperty("unnestFilter") DimFilter unnestFilter, + @Nullable @JsonProperty("outputName") String outputName + + ) + { + return new UnnestDataSource(base, virtualColumn, unnestFilter, outputName); + } + + // FIXME + @Deprecated public static UnnestDataSource create( @JsonProperty("base") DataSource base, @JsonProperty("virtualColumn") VirtualColumn virtualColumn, @@ -72,7 +91,7 @@ public static UnnestDataSource create( ) { - return new UnnestDataSource(base, virtualColumn, unnestFilter); + return create(base, virtualColumn, unnestFilter, null); } @JsonProperty("base") @@ -93,6 +112,14 @@ public DimFilter getUnnestFilter() return unnestFilter; } + @JsonInclude(Include.NON_NULL) + @JsonProperty("outputName") + public String getOutputName() + { + return outputName; + } + + @Override public Set getTableNames() { @@ -112,7 +139,7 @@ public DataSource withChildren(List children) throw new IAE("Expected [1] child, got [%d]", children.size()); } - return new UnnestDataSource(children.get(0), virtualColumn, unnestFilter); + return UnnestDataSource.create(children.get(0), virtualColumn, unnestFilter, outputName); } @Override @@ -145,14 +172,14 @@ public Function createSegmentMapFunction( ); return JvmUtils.safeAccumulateThreadCpuTime( cpuTimeAccumulator, - () -> baseSegment -> new UnnestSegment(segmentMapFn.apply(baseSegment), virtualColumn, unnestFilter) + () -> baseSegment -> new UnnestSegment(segmentMapFn.apply(baseSegment), virtualColumn, unnestFilter, outputName) ); } @Override public DataSource withUpdatedDataSource(DataSource newSource) { - return new UnnestDataSource(newSource, virtualColumn, unnestFilter); + return new UnnestDataSource(newSource, virtualColumn, unnestFilter, outputName); } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java b/processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java index 3337f3b43363..767d6fcf2bcc 100644 --- a/processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java +++ b/processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java @@ -25,6 +25,7 @@ import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.query.OrderBy; +import org.apache.druid.query.expression.TestExprMacroTable; import org.apache.druid.query.filter.BooleanFilter; import org.apache.druid.query.filter.DimFilter; import org.apache.druid.query.filter.EqualityFilter; @@ -62,16 +63,38 @@ public class UnnestCursorFactory implements CursorFactory private final VirtualColumn unnestColumn; @Nullable private final DimFilter filter; + private final String outputName; public UnnestCursorFactory( CursorFactory baseCursorFactory, VirtualColumn unnestColumn, - @Nullable DimFilter filter + @Nullable DimFilter filter, + String outputName ) { this.baseCursorFactory = baseCursorFactory; this.unnestColumn = unnestColumn; this.filter = filter; + this.outputName = outputName; + } + + // FIXME + @Deprecated + public UnnestCursorFactory( + CursorFactory baseCursorFactory, + VirtualColumn unnestColumn, + @Nullable DimFilter filter + ) + { + this(baseCursorFactory, unnestColumn, filter, null); + } + + private String getUnnestOutputColumn() + { + if (outputName != null) { + return outputName; + } + return unnestColumn.getOutputName(); } @Override @@ -86,10 +109,11 @@ public CursorHolder makeCursorHolder(CursorBuildSpec spec) input == null ? null : spec.getVirtualColumns() .getColumnCapabilitiesWithFallback(baseCursorFactory, input) ); + VirtualColumns vcs = getUnnestVCS(); final CursorBuildSpec unnestBuildSpec = CursorBuildSpec.builder(spec) .setFilter(filterPair.lhs) - .setVirtualColumns(VirtualColumns.create(Collections.singletonList(unnestColumn))) + .setVirtualColumns(vcs) .build(); return new CursorHolder() @@ -117,14 +141,14 @@ public Cursor asCursor() cursor, cursor.getColumnSelectorFactory(), unnestColumn, - unnestColumn.getOutputName() + getUnnestOutputColumn() ); } else { unnestCursor = new UnnestColumnValueSelectorCursor( cursor, cursor.getColumnSelectorFactory(), unnestColumn, - unnestColumn.getOutputName() + getUnnestOutputColumn() ); } return PostJoinCursor.wrap( @@ -134,6 +158,7 @@ public Cursor asCursor() ); } + @Override public List getOrdering() { @@ -148,6 +173,18 @@ public void close() }; } + private VirtualColumns getUnnestVCS() + { + if(outputName !=null ) { + ColumnCapabilities columnCapabilities = computeOutputColumnCapabilities(baseCursorFactory, unnestColumn); + ColumnType t = ColumnType.fromCapabilities(columnCapabilities); + ExpressionVirtualColumn e = new ExpressionVirtualColumn(outputName, "null", t, TestExprMacroTable.INSTANCE); + return VirtualColumns.create(unnestColumn, e); + }else { + return VirtualColumns.create(Collections.singletonList(unnestColumn)); + } + } + @Override public RowSignature getRowSignature() { diff --git a/processing/src/main/java/org/apache/druid/segment/UnnestSegment.java b/processing/src/main/java/org/apache/druid/segment/UnnestSegment.java index 22b63655f52d..ece7c0cce67e 100644 --- a/processing/src/main/java/org/apache/druid/segment/UnnestSegment.java +++ b/processing/src/main/java/org/apache/druid/segment/UnnestSegment.java @@ -29,22 +29,25 @@ public class UnnestSegment extends WrappedSegmentReference private final VirtualColumn unnestColumn; @Nullable private final DimFilter filter; + private final String outputName; public UnnestSegment( SegmentReference delegate, VirtualColumn unnestColumn, - @Nullable DimFilter filter + @Nullable DimFilter filter, + String outputName ) { super(delegate); this.unnestColumn = unnestColumn; this.filter = filter; + this.outputName = outputName; } @Override public CursorFactory asCursorFactory() { - return new UnnestCursorFactory(delegate.asCursorFactory(), unnestColumn, filter); + return new UnnestCursorFactory(delegate.asCursorFactory(), unnestColumn, filter, outputName); } @Nullable diff --git a/processing/src/test/java/org/apache/druid/segment/UnnestCursorFactoryTest.java b/processing/src/test/java/org/apache/druid/segment/UnnestCursorFactoryTest.java index 32770f91f2e5..80526893d522 100644 --- a/processing/src/test/java/org/apache/druid/segment/UnnestCursorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/segment/UnnestCursorFactoryTest.java @@ -115,6 +115,7 @@ public static void setup() throws IOException UNNEST_CURSOR_FACTORY = new UnnestCursorFactory( INCREMENTAL_INDEX_CURSOR_FACTORY, new ExpressionVirtualColumn(OUTPUT_COLUMN_NAME, "\"" + INPUT_COLUMN_NAME + "\"", null, ExprMacroTable.nil()), + null, null ); @@ -811,6 +812,7 @@ public void testUnnestValueMatcherValueDoesntExist() UnnestCursorFactory unnestCursorFactory = new UnnestCursorFactory( cursorFactory, new ExpressionVirtualColumn(OUTPUT_COLUMN_NAME, "\"" + inputColumn + "\"", null, ExprMacroTable.nil()), + null, null ); diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java index e5c6b40ed999..9723b7b1f7e3 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java @@ -70,11 +70,11 @@ public SourceDesc getSourceDesc(PlannerContext plannerContext, List VirtualColumn virtualColumn = buildUnnestVirtualColumn( plannerContext, inputDesc, - filterRowSignature.getColumnName(0) + outputRowSignature.getColumnName(inputDesc.rowSignature.size()) ); DimFilter dimFilter = buildDimFilter(plannerContext, filterRowSignature); - DataSource dataSource = UnnestDataSource.create(inputDesc.dataSource, virtualColumn, dimFilter); + DataSource dataSource = UnnestDataSource.create(inputDesc.dataSource, virtualColumn, dimFilter, filterRowSignature.getColumnName(0)); return new SourceDesc(dataSource, outputRowSignature); } @@ -114,10 +114,10 @@ private RowSignature computeRowOutputSignature(SourceDesc inputDesc) { return DruidJoinQueryRel.computeJoinRowSignature( inputDesc.rowSignature, - RowSignature.builder().add( - "unnest", - Calcites.getColumnTypeForRelDataType(getUnnestedType()) - ).build(), + RowSignature.builder() + .add("unnestExpr", Calcites.getColumnTypeForRelDataType(unnestExpr.getType())) + .add("unnest", Calcites.getColumnTypeForRelDataType(getUnnestedType())) + .build(), DruidJoinQueryRel.findExistingJoinPrefixes(inputDesc.dataSource) ).rhs; } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 3012575b7b35..7a3c44df7f9b 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4597,7 +4597,6 @@ public void testUnnestTwiceWithFiltersAndExpressions() ); } - @NotYetSupported(Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) @Test public void testUnnestThriceWithFiltersOnDimAndUnnestCol() diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java index 98a0a54c8224..726d708143b7 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java @@ -55,7 +55,7 @@ enum IgnoreQueriesReason */ UNNEST_EXTRA_SCANQUERY, /** - * Occurs in tandem with {@link NotYetSupported.Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS}. + * Occurs in tandem with {@link NotYetSupported.Modes#RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS}. */ RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS; diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq index 41ab9a29c26b..4761aa247fd6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq @@ -92,28 +92,27 @@ org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : Error while e at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) - at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) - at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:95) + at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:91) + at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:60) + at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98) + at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40) + at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529) + at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756) + at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452) + at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210) org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.query.filter.DruidPredicateFactory.makeArrayPredicate(DruidPredicateFactory.java:42) at org.apache.druid.segment.filter.PredicateValueMatcherFactory.makeArrayProcessor(PredicateValueMatcherFactory.java:110) at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:90) - at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:39) + at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:1) at org.apache.druid.segment.ColumnProcessors.makeProcessorInternal(ColumnProcessors.java:290) at org.apache.druid.segment.ColumnProcessors.makeProcessor(ColumnProcessors.java:77) at org.apache.druid.segment.filter.SelectorFilter.makeMatcher(SelectorFilter.java:115) @@ -125,16 +124,16 @@ org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.query.scan.ScanQueryEngine$1.make(ScanQueryEngine.java:143) at org.apache.druid.java.util.common.guava.BaseSequence.toYielder(BaseSequence.java:66) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.query.spec.SpecificSegmentQueryRunner$1.toYielder(SpecificSegmentQueryRunner.java:113) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.query.spec.SpecificSegmentQueryRunner.doNamed(SpecificSegmentQueryRunner.java:185) at org.apache.druid.query.spec.SpecificSegmentQueryRunner$2.wrap(SpecificSegmentQueryRunner.java:165) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) @@ -144,27 +143,27 @@ org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.LazySequence.toYielder(LazySequence.java:46) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.MergeSequence.lambda$toYielder$0(MergeSequence.java:66) + at org.apache.druid.java.util.common.guava.MergeSequence.lambda$1(MergeSequence.java:66) at org.apache.druid.java.util.common.guava.BaseSequence.accumulate(BaseSequence.java:44) at org.apache.druid.java.util.common.guava.MergeSequence.toYielder(MergeSequence.java:63) at org.apache.druid.query.RetryQueryRunner$1.toYielder(RetryQueryRunner.java:133) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.query.CPUTimeMetricQueryRunner$1.wrap(CPUTimeMetricQueryRunner.java:77) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:51) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.Yielders.each(Yielders.java:32) - at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$execute$0(DruidJdbcResultSet.java:239) + at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$0(DruidJdbcResultSet.java:239) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq index 05790207aa95..de2e331b37a3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq @@ -19,16 +19,16 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (2 rows) !ok -LogicalProject(t=[$0], d3=[$3]) +LogicalProject(t=[$0], d3=[$2]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3]) LogicalFilter(condition=[=($2, 'a')]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$3], druid=[logical]) +DruidProject(t=[$0], d3=[$2], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0], druid=[logical]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], druid=[logical]) DruidFilter(condition=[=($2, 'a')]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -61,8 +61,8 @@ DruidProject(t=[$0], d3=[$3], druid=[logical]) "dimension" : "dim2", "value" : "a" }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0", "dim3" ], + "columnTypes" : [ "LONG", "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq index 26485b8d1e42..d0846d3cad30 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq @@ -45,10 +45,9 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "equals", - "column" : "j0.unnest", - "matchValueType" : "STRING", - "matchValue" : "b" + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "b" } }, "intervals" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq index 9b9802c0645b..8b64c5e5f03e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq @@ -19,16 +19,16 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (2 rows) !ok -LogicalProject(t=[$0], d3=[$3]) +LogicalProject(t=[$0], d3=[$2]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3]) LogicalFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$3], druid=[logical]) +DruidProject(t=[$0], d3=[$2], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0], druid=[logical]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], druid=[logical]) DruidFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -61,8 +61,8 @@ DruidProject(t=[$0], d3=[$3], druid=[logical]) "dimension" : "dim2", "values" : [ "a", "b" ] }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0", "dim3" ], + "columnTypes" : [ "LONG", "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq index e4645bff7d32..70979223a8e8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq @@ -21,15 +21,13 @@ SELECT dim2, SUM(cnt), COUNT(distinct dim1) FROM druid.foo GROUP BY dim2; !ok LogicalAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{0, 1}], EXPR$1=[SUM($2)]) - LogicalProject(dim1=[$1], dim2=[$2], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1, 2}], EXPR$1=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$1=[SUM($2)], druid=[logical]) - DruidProject(dim1=[$1], dim2=[$2], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1, 2}], EXPR$1=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq index 71b6867f5ced..ee8ff3e4ed42 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq @@ -21,19 +21,17 @@ SELECT dim4, substring(dim5, 1, 1), count(*) FROM druid.numfoo WHERE dim4 = 'a' LogicalProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1]) LogicalSort(fetch=[2]) LogicalAggregate(group=[{0}], EXPR$2=[COUNT()]) - LogicalProject(EXPR$1=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[=($0, 'a')]) - LogicalProject(dim4=[$4], dim5=[$5]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalProject(EXPR$1=[SUBSTRING($5, 1, 1)]) + LogicalFilter(condition=[=($4, 'a')]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1], druid=[logical]) DruidSort(fetch=[2], druid=[logical]) DruidAggregate(group=[{0}], EXPR$2=[COUNT()], druid=[logical]) - DruidProject(EXPR$1=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[=($0, 'a')]) - DruidProject(dim4=[$4], dim5=[$5], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidProject(EXPR$1=[SUBSTRING($5, 1, 1)], druid=[logical]) + DruidFilter(condition=[=($4, 'a')]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq index 65cce7cc14b4..da905b0336c1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq @@ -30,8 +30,8 @@ SELECT +-------+----+ | t1 | t2 | +-------+----+ -| dummy | b | | dummy | | +| dummy | b | +-------+----+ (2 rows) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq index 6231ea35d4a6..092819fbb036 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq @@ -23,33 +23,27 @@ SELECT dim2, COUNT(*), COUNT(distinct dim1), COUNT(distinct cnt) FROM druid.foo LogicalProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{1}], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{0, 1}]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], EXPR$3=[COUNT()]) - LogicalAggregate(group=[{0, 1}]) - LogicalProject(dim2=[$2], cnt=[$4]) + LogicalAggregate(group=[{1, 2}]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}], EXPR$3=[COUNT()]) + LogicalAggregate(group=[{2, 4}]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5], druid=[logical]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{1}], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{0, 1}], druid=[logical]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], EXPR$3=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0, 1}], druid=[logical]) - DruidProject(dim2=[$2], cnt=[$4], druid=[logical]) + DruidAggregate(group=[{1, 2}], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], EXPR$3=[COUNT()], druid=[logical]) + DruidAggregate(group=[{2, 4}], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq deleted file mode 100644 index e84db59af531..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq +++ /dev/null @@ -1,110 +0,0 @@ -# testSubqueryTypeMismatchWithLiterals@NullHandling=default case-crc:e7079756 -# quidem testcase reason: AGGREGATE_REMOVE_NOT_FIRED -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT - dim1, - SUM(CASE WHEN sum_l1 = 0 THEN 1 ELSE 0 END) AS outer_l1 -from ( - select - dim1, - SUM(l1) as sum_l1 - from numfoo - group by dim1 -) -group by 1; -+------+----------+ -| dim1 | outer_l1 | -+------+----------+ -| | 0 | -| 1 | 1 | -| 10.1 | 0 | -| 2 | 1 | -| abc | 1 | -| def | 1 | -+------+----------+ -(6 rows) - -!ok -LogicalAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1]) - LogicalProject(dim1=[$0], $f2=[=($1, 0)]) - LogicalAggregate(group=[{1}], sum_l1=[SUM($11)]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1], druid=[logical]) - DruidProject(dim1=[$0], $f2=[=($1, 0)], druid=[logical]) - DruidAggregate(group=[{1}], sum_l1=[SUM($11)], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "longSum", - "name" : "a0", - "fieldName" : "l1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "_d0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "_a0" - }, - "filter" : { - "type" : "selector", - "dimension" : "a0", - "value" : "0" - }, - "name" : "_a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq deleted file mode 100644 index b464b19c371a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testSubqueryTypeMismatchWithLiterals@NullHandling=sql case-crc:e7079756 -# quidem testcase reason: AGGREGATE_REMOVE_NOT_FIRED -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT - dim1, - SUM(CASE WHEN sum_l1 = 0 THEN 1 ELSE 0 END) AS outer_l1 -from ( - select - dim1, - SUM(l1) as sum_l1 - from numfoo - group by dim1 -) -group by 1; -+------+----------+ -| dim1 | outer_l1 | -+------+----------+ -| | 0 | -| 1 | 0 | -| 10.1 | 0 | -| 2 | 1 | -| abc | 0 | -| def | 0 | -+------+----------+ -(6 rows) - -!ok -LogicalAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1]) - LogicalProject(dim1=[$0], $f2=[IS TRUE(=($1, 0))]) - LogicalAggregate(group=[{1}], sum_l1=[SUM($11)]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1], druid=[logical]) - DruidProject(dim1=[$0], $f2=[IS TRUE(=($1, 0))], druid=[logical]) - DruidAggregate(group=[{1}], sum_l1=[SUM($11)], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "longSum", - "name" : "a0", - "fieldName" : "l1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "_d0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "_a0" - }, - "filter" : { - "type" : "equals", - "column" : "a0", - "matchValueType" : "LONG", - "matchValue" : 0 - }, - "name" : "_a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq deleted file mode 100644 index 6a74658a830b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq +++ /dev/null @@ -1,92 +0,0 @@ -# testTimeFilterOnSubquery@NullHandling=default case-crc:73448efc -# quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, m1 FROM (SELECT * FROM "foo" LIMIT 100) -WHERE TIME_IN_INTERVAL(__time, '2000/P1D') OR TIME_IN_INTERVAL(__time, '2001/P1D'); -+-------------------------+-----+ -| __time | m1 | -+-------------------------+-----+ -| 2000-01-01 00:00:00.000 | 1.0 | -| 2001-01-01 00:00:00.000 | 4.0 | -+-------------------------+-----+ -(2 rows) - -!ok -LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - LogicalSort(fetch=[100]) - LogicalProject(__time=[$0], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - DruidSort(fetch=[100], druid=[logical]) - DruidProject(__time=[$0], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "m1" ], - "columnTypes" : [ "LONG", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "bound", - "dimension" : "__time", - "lower" : "946684800000", - "upper" : "946771200000", - "upperStrict" : true, - "ordering" : { - "type" : "numeric" - } - }, { - "type" : "bound", - "dimension" : "__time", - "lower" : "978307200000", - "upper" : "978393600000", - "upperStrict" : true, - "ordering" : { - "type" : "numeric" - } - } ] - }, - "columns" : [ "__time", "m1" ], - "columnTypes" : [ "LONG", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq deleted file mode 100644 index 08aa7cdd3eb8..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq +++ /dev/null @@ -1,88 +0,0 @@ -# testTimeFilterOnSubquery@NullHandling=sql case-crc:73448efc -# quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, m1 FROM (SELECT * FROM "foo" LIMIT 100) -WHERE TIME_IN_INTERVAL(__time, '2000/P1D') OR TIME_IN_INTERVAL(__time, '2001/P1D'); -+-------------------------+-----+ -| __time | m1 | -+-------------------------+-----+ -| 2000-01-01 00:00:00.000 | 1.0 | -| 2001-01-01 00:00:00.000 | 4.0 | -+-------------------------+-----+ -(2 rows) - -!ok -LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - LogicalSort(fetch=[100]) - LogicalProject(__time=[$0], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - DruidSort(fetch=[100], druid=[logical]) - DruidProject(__time=[$0], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "m1" ], - "columnTypes" : [ "LONG", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "range", - "column" : "__time", - "matchValueType" : "LONG", - "lower" : 946684800000, - "upper" : 946771200000, - "upperOpen" : true - }, { - "type" : "range", - "column" : "__time", - "matchValueType" : "LONG", - "lower" : 978307200000, - "upper" : 978393600000, - "upperOpen" : true - } ] - }, - "columns" : [ "__time", "m1" ], - "columnTypes" : [ "LONG", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq index 8478efa187be..a893185365e6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq @@ -35,9 +35,8 @@ LogicalProject(ranking=[$2], trend_score=[$1]) LogicalSort(fetch=[10]) LogicalWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) LogicalProject(m2=[$1], trend_score=[$2]) - LogicalAggregate(group=[{0, 1}], trend_score=[COUNT()]) - LogicalProject(m1=[$5], m2=[$6]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{5, 6}], trend_score=[COUNT()]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) @@ -45,9 +44,8 @@ DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) DruidSort(fetch=[10], druid=[logical]) DruidWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) DruidProject(m2=[$1], trend_score=[$2], druid=[logical]) - DruidAggregate(group=[{0, 1}], trend_score=[COUNT()], druid=[logical]) - DruidProject(m1=[$5], m2=[$6], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{5, 6}], trend_score=[COUNT()], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { From adfdbde9224660195f922cf247fac9eb83261e52 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Sat, 7 Dec 2024 15:59:13 +0000 Subject: [PATCH 73/99] Revert "try to fix unnest outputColumn" This reverts commit e195135452bc3fa1493aad72c3b7ec5d125219b7. --- .../apache/druid/query/UnnestDataSource.java | 39 +----- .../druid/segment/UnnestCursorFactory.java | 45 +------ .../apache/druid/segment/UnnestSegment.java | 7 +- .../segment/UnnestCursorFactoryTest.java | 2 - .../sql/calcite/rule/logical/DruidUnnest.java | 12 +- .../sql/calcite/CalciteArraysQueryTest.java | 1 + .../sql/calcite/DecoupledTestConfig.java | 2 +- ...olumnsArrayColumns@NullHandling=default.iq | 51 ++++---- ...essionInInnerQuery@NullHandling=default.iq | 12 +- .../testUnnestWithGroupByHavingSelector.iq | 7 +- ...essionInInnerQuery@NullHandling=default.iq | 12 +- ...ndOtherAggregators@NullHandling=default.iq | 10 +- ...PushdownExtraction@NullHandling=default.iq | 14 ++- ...estGroupByWithLiteralInSubqueryGrouping.iq | 2 +- ...gregatorsUsingJoin@NullHandling=default.iq | 30 +++-- ...smatchWithLiterals@NullHandling=default.iq | 110 +++++++++++++++++ ...peMismatchWithLiterals@NullHandling=sql.iq | 111 ++++++++++++++++++ ...meFilterOnSubquery@NullHandling=default.iq | 92 +++++++++++++++ ...stTimeFilterOnSubquery@NullHandling=sql.iq | 88 ++++++++++++++ ...ingWithScanAndSort@NullHandling=default.iq | 10 +- 20 files changed, 502 insertions(+), 155 deletions(-) create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq diff --git a/processing/src/main/java/org/apache/druid/query/UnnestDataSource.java b/processing/src/main/java/org/apache/druid/query/UnnestDataSource.java index 5454486398fe..06acca13a754 100644 --- a/processing/src/main/java/org/apache/druid/query/UnnestDataSource.java +++ b/processing/src/main/java/org/apache/druid/query/UnnestDataSource.java @@ -20,8 +20,6 @@ package org.apache.druid.query; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableList; import org.apache.druid.java.util.common.IAE; @@ -33,7 +31,6 @@ import org.apache.druid.utils.JvmUtils; import javax.annotation.Nullable; - import java.util.List; import java.util.Objects; import java.util.Set; @@ -52,8 +49,6 @@ public class UnnestDataSource implements DataSource { private final DataSource base; private final VirtualColumn virtualColumn; - @Nullable - private final String outputName; @Nullable private final DimFilter unnestFilter; @@ -61,29 +56,15 @@ public class UnnestDataSource implements DataSource private UnnestDataSource( DataSource dataSource, VirtualColumn virtualColumn, - DimFilter unnestFilter, - @Nullable String outputName) + DimFilter unnestFilter + ) { this.base = dataSource; this.virtualColumn = virtualColumn; this.unnestFilter = unnestFilter; - this.outputName = outputName; } @JsonCreator - public static UnnestDataSource create( - @JsonProperty("base") DataSource base, - @JsonProperty("virtualColumn") VirtualColumn virtualColumn, - @Nullable @JsonProperty("unnestFilter") DimFilter unnestFilter, - @Nullable @JsonProperty("outputName") String outputName - - ) - { - return new UnnestDataSource(base, virtualColumn, unnestFilter, outputName); - } - - // FIXME - @Deprecated public static UnnestDataSource create( @JsonProperty("base") DataSource base, @JsonProperty("virtualColumn") VirtualColumn virtualColumn, @@ -91,7 +72,7 @@ public static UnnestDataSource create( ) { - return create(base, virtualColumn, unnestFilter, null); + return new UnnestDataSource(base, virtualColumn, unnestFilter); } @JsonProperty("base") @@ -112,14 +93,6 @@ public DimFilter getUnnestFilter() return unnestFilter; } - @JsonInclude(Include.NON_NULL) - @JsonProperty("outputName") - public String getOutputName() - { - return outputName; - } - - @Override public Set getTableNames() { @@ -139,7 +112,7 @@ public DataSource withChildren(List children) throw new IAE("Expected [1] child, got [%d]", children.size()); } - return UnnestDataSource.create(children.get(0), virtualColumn, unnestFilter, outputName); + return new UnnestDataSource(children.get(0), virtualColumn, unnestFilter); } @Override @@ -172,14 +145,14 @@ public Function createSegmentMapFunction( ); return JvmUtils.safeAccumulateThreadCpuTime( cpuTimeAccumulator, - () -> baseSegment -> new UnnestSegment(segmentMapFn.apply(baseSegment), virtualColumn, unnestFilter, outputName) + () -> baseSegment -> new UnnestSegment(segmentMapFn.apply(baseSegment), virtualColumn, unnestFilter) ); } @Override public DataSource withUpdatedDataSource(DataSource newSource) { - return new UnnestDataSource(newSource, virtualColumn, unnestFilter, outputName); + return new UnnestDataSource(newSource, virtualColumn, unnestFilter); } @Override diff --git a/processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java b/processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java index 767d6fcf2bcc..3337f3b43363 100644 --- a/processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java +++ b/processing/src/main/java/org/apache/druid/segment/UnnestCursorFactory.java @@ -25,7 +25,6 @@ import org.apache.druid.java.util.common.Pair; import org.apache.druid.java.util.common.io.Closer; import org.apache.druid.query.OrderBy; -import org.apache.druid.query.expression.TestExprMacroTable; import org.apache.druid.query.filter.BooleanFilter; import org.apache.druid.query.filter.DimFilter; import org.apache.druid.query.filter.EqualityFilter; @@ -63,38 +62,16 @@ public class UnnestCursorFactory implements CursorFactory private final VirtualColumn unnestColumn; @Nullable private final DimFilter filter; - private final String outputName; public UnnestCursorFactory( CursorFactory baseCursorFactory, VirtualColumn unnestColumn, - @Nullable DimFilter filter, - String outputName + @Nullable DimFilter filter ) { this.baseCursorFactory = baseCursorFactory; this.unnestColumn = unnestColumn; this.filter = filter; - this.outputName = outputName; - } - - // FIXME - @Deprecated - public UnnestCursorFactory( - CursorFactory baseCursorFactory, - VirtualColumn unnestColumn, - @Nullable DimFilter filter - ) - { - this(baseCursorFactory, unnestColumn, filter, null); - } - - private String getUnnestOutputColumn() - { - if (outputName != null) { - return outputName; - } - return unnestColumn.getOutputName(); } @Override @@ -109,11 +86,10 @@ public CursorHolder makeCursorHolder(CursorBuildSpec spec) input == null ? null : spec.getVirtualColumns() .getColumnCapabilitiesWithFallback(baseCursorFactory, input) ); - VirtualColumns vcs = getUnnestVCS(); final CursorBuildSpec unnestBuildSpec = CursorBuildSpec.builder(spec) .setFilter(filterPair.lhs) - .setVirtualColumns(vcs) + .setVirtualColumns(VirtualColumns.create(Collections.singletonList(unnestColumn))) .build(); return new CursorHolder() @@ -141,14 +117,14 @@ public Cursor asCursor() cursor, cursor.getColumnSelectorFactory(), unnestColumn, - getUnnestOutputColumn() + unnestColumn.getOutputName() ); } else { unnestCursor = new UnnestColumnValueSelectorCursor( cursor, cursor.getColumnSelectorFactory(), unnestColumn, - getUnnestOutputColumn() + unnestColumn.getOutputName() ); } return PostJoinCursor.wrap( @@ -158,7 +134,6 @@ public Cursor asCursor() ); } - @Override public List getOrdering() { @@ -173,18 +148,6 @@ public void close() }; } - private VirtualColumns getUnnestVCS() - { - if(outputName !=null ) { - ColumnCapabilities columnCapabilities = computeOutputColumnCapabilities(baseCursorFactory, unnestColumn); - ColumnType t = ColumnType.fromCapabilities(columnCapabilities); - ExpressionVirtualColumn e = new ExpressionVirtualColumn(outputName, "null", t, TestExprMacroTable.INSTANCE); - return VirtualColumns.create(unnestColumn, e); - }else { - return VirtualColumns.create(Collections.singletonList(unnestColumn)); - } - } - @Override public RowSignature getRowSignature() { diff --git a/processing/src/main/java/org/apache/druid/segment/UnnestSegment.java b/processing/src/main/java/org/apache/druid/segment/UnnestSegment.java index ece7c0cce67e..22b63655f52d 100644 --- a/processing/src/main/java/org/apache/druid/segment/UnnestSegment.java +++ b/processing/src/main/java/org/apache/druid/segment/UnnestSegment.java @@ -29,25 +29,22 @@ public class UnnestSegment extends WrappedSegmentReference private final VirtualColumn unnestColumn; @Nullable private final DimFilter filter; - private final String outputName; public UnnestSegment( SegmentReference delegate, VirtualColumn unnestColumn, - @Nullable DimFilter filter, - String outputName + @Nullable DimFilter filter ) { super(delegate); this.unnestColumn = unnestColumn; this.filter = filter; - this.outputName = outputName; } @Override public CursorFactory asCursorFactory() { - return new UnnestCursorFactory(delegate.asCursorFactory(), unnestColumn, filter, outputName); + return new UnnestCursorFactory(delegate.asCursorFactory(), unnestColumn, filter); } @Nullable diff --git a/processing/src/test/java/org/apache/druid/segment/UnnestCursorFactoryTest.java b/processing/src/test/java/org/apache/druid/segment/UnnestCursorFactoryTest.java index 80526893d522..32770f91f2e5 100644 --- a/processing/src/test/java/org/apache/druid/segment/UnnestCursorFactoryTest.java +++ b/processing/src/test/java/org/apache/druid/segment/UnnestCursorFactoryTest.java @@ -115,7 +115,6 @@ public static void setup() throws IOException UNNEST_CURSOR_FACTORY = new UnnestCursorFactory( INCREMENTAL_INDEX_CURSOR_FACTORY, new ExpressionVirtualColumn(OUTPUT_COLUMN_NAME, "\"" + INPUT_COLUMN_NAME + "\"", null, ExprMacroTable.nil()), - null, null ); @@ -812,7 +811,6 @@ public void testUnnestValueMatcherValueDoesntExist() UnnestCursorFactory unnestCursorFactory = new UnnestCursorFactory( cursorFactory, new ExpressionVirtualColumn(OUTPUT_COLUMN_NAME, "\"" + inputColumn + "\"", null, ExprMacroTable.nil()), - null, null ); diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java index 9723b7b1f7e3..e5c6b40ed999 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/DruidUnnest.java @@ -70,11 +70,11 @@ public SourceDesc getSourceDesc(PlannerContext plannerContext, List VirtualColumn virtualColumn = buildUnnestVirtualColumn( plannerContext, inputDesc, - outputRowSignature.getColumnName(inputDesc.rowSignature.size()) + filterRowSignature.getColumnName(0) ); DimFilter dimFilter = buildDimFilter(plannerContext, filterRowSignature); - DataSource dataSource = UnnestDataSource.create(inputDesc.dataSource, virtualColumn, dimFilter, filterRowSignature.getColumnName(0)); + DataSource dataSource = UnnestDataSource.create(inputDesc.dataSource, virtualColumn, dimFilter); return new SourceDesc(dataSource, outputRowSignature); } @@ -114,10 +114,10 @@ private RowSignature computeRowOutputSignature(SourceDesc inputDesc) { return DruidJoinQueryRel.computeJoinRowSignature( inputDesc.rowSignature, - RowSignature.builder() - .add("unnestExpr", Calcites.getColumnTypeForRelDataType(unnestExpr.getType())) - .add("unnest", Calcites.getColumnTypeForRelDataType(getUnnestedType())) - .build(), + RowSignature.builder().add( + "unnest", + Calcites.getColumnTypeForRelDataType(getUnnestedType()) + ).build(), DruidJoinQueryRel.findExistingJoinPrefixes(inputDesc.dataSource) ).rhs; } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 7a3c44df7f9b..3012575b7b35 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4597,6 +4597,7 @@ public void testUnnestTwiceWithFiltersAndExpressions() ); } + @NotYetSupported(Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) @Test public void testUnnestThriceWithFiltersOnDimAndUnnestCol() diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java index 726d708143b7..98a0a54c8224 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java @@ -55,7 +55,7 @@ enum IgnoreQueriesReason */ UNNEST_EXTRA_SCANQUERY, /** - * Occurs in tandem with {@link NotYetSupported.Modes#RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS}. + * Occurs in tandem with {@link NotYetSupported.Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS}. */ RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS; diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq index 4761aa247fd6..41ab9a29c26b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq @@ -92,27 +92,28 @@ org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : Error while e at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:95) - at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:91) - at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:60) - at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98) - at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) + at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) + at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.query.filter.DruidPredicateFactory.makeArrayPredicate(DruidPredicateFactory.java:42) at org.apache.druid.segment.filter.PredicateValueMatcherFactory.makeArrayProcessor(PredicateValueMatcherFactory.java:110) at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:90) - at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:1) + at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:39) at org.apache.druid.segment.ColumnProcessors.makeProcessorInternal(ColumnProcessors.java:290) at org.apache.druid.segment.ColumnProcessors.makeProcessor(ColumnProcessors.java:77) at org.apache.druid.segment.filter.SelectorFilter.makeMatcher(SelectorFilter.java:115) @@ -124,16 +125,16 @@ org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.query.scan.ScanQueryEngine$1.make(ScanQueryEngine.java:143) at org.apache.druid.java.util.common.guava.BaseSequence.toYielder(BaseSequence.java:66) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.query.spec.SpecificSegmentQueryRunner$1.toYielder(SpecificSegmentQueryRunner.java:113) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.query.spec.SpecificSegmentQueryRunner.doNamed(SpecificSegmentQueryRunner.java:185) at org.apache.druid.query.spec.SpecificSegmentQueryRunner$2.wrap(SpecificSegmentQueryRunner.java:165) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) @@ -143,27 +144,27 @@ org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.LazySequence.toYielder(LazySequence.java:46) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.MergeSequence.lambda$1(MergeSequence.java:66) + at org.apache.druid.java.util.common.guava.MergeSequence.lambda$toYielder$0(MergeSequence.java:66) at org.apache.druid.java.util.common.guava.BaseSequence.accumulate(BaseSequence.java:44) at org.apache.druid.java.util.common.guava.MergeSequence.toYielder(MergeSequence.java:63) at org.apache.druid.query.RetryQueryRunner$1.toYielder(RetryQueryRunner.java:133) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.query.CPUTimeMetricQueryRunner$1.wrap(CPUTimeMetricQueryRunner.java:77) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:51) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.Yielders.each(Yielders.java:32) - at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$0(DruidJdbcResultSet.java:239) + at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$execute$0(DruidJdbcResultSet.java:239) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq index de2e331b37a3..05790207aa95 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq @@ -19,16 +19,16 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (2 rows) !ok -LogicalProject(t=[$0], d3=[$2]) +LogicalProject(t=[$0], d3=[$3]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0]) LogicalFilter(condition=[=($2, 'a')]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$2], druid=[logical]) +DruidProject(t=[$0], d3=[$3], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], druid=[logical]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0], druid=[logical]) DruidFilter(condition=[=($2, 'a')]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -61,8 +61,8 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "dimension" : "dim2", "value" : "a" }, - "columns" : [ "v0", "dim3" ], - "columnTypes" : [ "LONG", "STRING" ], + "columns" : [ "v0", "dim3", "__time" ], + "columnTypes" : [ "LONG", "STRING", "LONG" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq index d0846d3cad30..26485b8d1e42 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq @@ -45,9 +45,10 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "b" + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "b" } }, "intervals" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq index 8b64c5e5f03e..9b9802c0645b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq @@ -19,16 +19,16 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (2 rows) !ok -LogicalProject(t=[$0], d3=[$2]) +LogicalProject(t=[$0], d3=[$3]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0]) LogicalFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$2], druid=[logical]) +DruidProject(t=[$0], d3=[$3], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], druid=[logical]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0], druid=[logical]) DruidFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -61,8 +61,8 @@ DruidProject(t=[$0], d3=[$2], druid=[logical]) "dimension" : "dim2", "values" : [ "a", "b" ] }, - "columns" : [ "v0", "dim3" ], - "columnTypes" : [ "LONG", "STRING" ], + "columns" : [ "v0", "dim3", "__time" ], + "columnTypes" : [ "LONG", "STRING", "LONG" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq index 70979223a8e8..e4645bff7d32 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq @@ -21,13 +21,15 @@ SELECT dim2, SUM(cnt), COUNT(distinct dim1) FROM druid.foo GROUP BY dim2; !ok LogicalAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{1, 2}], EXPR$1=[SUM($4)]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0, 1}], EXPR$1=[SUM($2)]) + LogicalProject(dim1=[$1], dim2=[$2], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{1, 2}], EXPR$1=[SUM($4)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0, 1}], EXPR$1=[SUM($2)], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq index ee8ff3e4ed42..71b6867f5ced 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq @@ -21,17 +21,19 @@ SELECT dim4, substring(dim5, 1, 1), count(*) FROM druid.numfoo WHERE dim4 = 'a' LogicalProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1]) LogicalSort(fetch=[2]) LogicalAggregate(group=[{0}], EXPR$2=[COUNT()]) - LogicalProject(EXPR$1=[SUBSTRING($5, 1, 1)]) - LogicalFilter(condition=[=($4, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalProject(EXPR$1=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[=($0, 'a')]) + LogicalProject(dim4=[$4], dim5=[$5]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1], druid=[logical]) DruidSort(fetch=[2], druid=[logical]) DruidAggregate(group=[{0}], EXPR$2=[COUNT()], druid=[logical]) - DruidProject(EXPR$1=[SUBSTRING($5, 1, 1)], druid=[logical]) - DruidFilter(condition=[=($4, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidProject(EXPR$1=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[=($0, 'a')]) + DruidProject(dim4=[$4], dim5=[$5], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq index da905b0336c1..65cce7cc14b4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq @@ -30,8 +30,8 @@ SELECT +-------+----+ | t1 | t2 | +-------+----+ -| dummy | | | dummy | b | +| dummy | | +-------+----+ (2 rows) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq index 092819fbb036..6231ea35d4a6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq @@ -23,27 +23,33 @@ SELECT dim2, COUNT(*), COUNT(distinct dim1), COUNT(distinct cnt) FROM druid.foo LogicalProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{1, 2}]) + LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) + LogicalProject(dim2=[$2]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}], EXPR$2=[COUNT($0)]) + LogicalAggregate(group=[{0, 1}]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], EXPR$3=[COUNT()]) - LogicalAggregate(group=[{2, 4}]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0, 1}]) + LogicalProject(dim2=[$2], cnt=[$4]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5], druid=[logical]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{1, 2}], druid=[logical]) + DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) + DruidProject(dim2=[$2], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], EXPR$2=[COUNT($0)], druid=[logical]) + DruidAggregate(group=[{0, 1}], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], EXPR$3=[COUNT()], druid=[logical]) - DruidAggregate(group=[{2, 4}], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0, 1}], druid=[logical]) + DruidProject(dim2=[$2], cnt=[$4], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq new file mode 100644 index 000000000000..e84db59af531 --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq @@ -0,0 +1,110 @@ +# testSubqueryTypeMismatchWithLiterals@NullHandling=default case-crc:e7079756 +# quidem testcase reason: AGGREGATE_REMOVE_NOT_FIRED +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set outputformat mysql +!use druidtest:/// +SELECT + dim1, + SUM(CASE WHEN sum_l1 = 0 THEN 1 ELSE 0 END) AS outer_l1 +from ( + select + dim1, + SUM(l1) as sum_l1 + from numfoo + group by dim1 +) +group by 1; ++------+----------+ +| dim1 | outer_l1 | ++------+----------+ +| | 0 | +| 1 | 1 | +| 10.1 | 0 | +| 2 | 1 | +| abc | 1 | +| def | 1 | ++------+----------+ +(6 rows) + +!ok +LogicalAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1]) + LogicalProject(dim1=[$0], $f2=[=($1, 0)]) + LogicalAggregate(group=[{1}], sum_l1=[SUM($11)]) + LogicalTableScan(table=[[druid, numfoo]]) + +!logicalPlan +DruidAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1], druid=[logical]) + DruidProject(dim1=[$0], $f2=[=($1, 0)], druid=[logical]) + DruidAggregate(group=[{1}], sum_l1=[SUM($11)], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + +!druidPlan +{ + "queryType" : "groupBy", + "dataSource" : { + "type" : "query", + "query" : { + "queryType" : "groupBy", + "dataSource" : { + "type" : "table", + "name" : "numfoo" + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "granularity" : { + "type" : "all" + }, + "dimensions" : [ { + "type" : "default", + "dimension" : "dim1", + "outputName" : "_d0", + "outputType" : "STRING" + } ], + "aggregations" : [ { + "type" : "longSum", + "name" : "a0", + "fieldName" : "l1" + } ], + "limitSpec" : { + "type" : "NoopLimitSpec" + } + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "granularity" : { + "type" : "all" + }, + "dimensions" : [ { + "type" : "default", + "dimension" : "_d0", + "outputName" : "d0", + "outputType" : "STRING" + } ], + "aggregations" : [ { + "type" : "filtered", + "aggregator" : { + "type" : "count", + "name" : "_a0" + }, + "filter" : { + "type" : "selector", + "dimension" : "a0", + "value" : "0" + }, + "name" : "_a0" + } ], + "limitSpec" : { + "type" : "NoopLimitSpec" + } +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq new file mode 100644 index 000000000000..b464b19c371a --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq @@ -0,0 +1,111 @@ +# testSubqueryTypeMismatchWithLiterals@NullHandling=sql case-crc:e7079756 +# quidem testcase reason: AGGREGATE_REMOVE_NOT_FIRED +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set outputformat mysql +!use druidtest:/// +SELECT + dim1, + SUM(CASE WHEN sum_l1 = 0 THEN 1 ELSE 0 END) AS outer_l1 +from ( + select + dim1, + SUM(l1) as sum_l1 + from numfoo + group by dim1 +) +group by 1; ++------+----------+ +| dim1 | outer_l1 | ++------+----------+ +| | 0 | +| 1 | 0 | +| 10.1 | 0 | +| 2 | 1 | +| abc | 0 | +| def | 0 | ++------+----------+ +(6 rows) + +!ok +LogicalAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1]) + LogicalProject(dim1=[$0], $f2=[IS TRUE(=($1, 0))]) + LogicalAggregate(group=[{1}], sum_l1=[SUM($11)]) + LogicalTableScan(table=[[druid, numfoo]]) + +!logicalPlan +DruidAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1], druid=[logical]) + DruidProject(dim1=[$0], $f2=[IS TRUE(=($1, 0))], druid=[logical]) + DruidAggregate(group=[{1}], sum_l1=[SUM($11)], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + +!druidPlan +{ + "queryType" : "groupBy", + "dataSource" : { + "type" : "query", + "query" : { + "queryType" : "groupBy", + "dataSource" : { + "type" : "table", + "name" : "numfoo" + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "granularity" : { + "type" : "all" + }, + "dimensions" : [ { + "type" : "default", + "dimension" : "dim1", + "outputName" : "_d0", + "outputType" : "STRING" + } ], + "aggregations" : [ { + "type" : "longSum", + "name" : "a0", + "fieldName" : "l1" + } ], + "limitSpec" : { + "type" : "NoopLimitSpec" + } + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "granularity" : { + "type" : "all" + }, + "dimensions" : [ { + "type" : "default", + "dimension" : "_d0", + "outputName" : "d0", + "outputType" : "STRING" + } ], + "aggregations" : [ { + "type" : "filtered", + "aggregator" : { + "type" : "count", + "name" : "_a0" + }, + "filter" : { + "type" : "equals", + "column" : "a0", + "matchValueType" : "LONG", + "matchValue" : 0 + }, + "name" : "_a0" + } ], + "limitSpec" : { + "type" : "NoopLimitSpec" + } +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq new file mode 100644 index 000000000000..6a74658a830b --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq @@ -0,0 +1,92 @@ +# testTimeFilterOnSubquery@NullHandling=default case-crc:73448efc +# quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set outputformat mysql +!use druidtest:/// +SELECT __time, m1 FROM (SELECT * FROM "foo" LIMIT 100) +WHERE TIME_IN_INTERVAL(__time, '2000/P1D') OR TIME_IN_INTERVAL(__time, '2001/P1D'); ++-------------------------+-----+ +| __time | m1 | ++-------------------------+-----+ +| 2000-01-01 00:00:00.000 | 1.0 | +| 2001-01-01 00:00:00.000 | 4.0 | ++-------------------------+-----+ +(2 rows) + +!ok +LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) + LogicalSort(fetch=[100]) + LogicalProject(__time=[$0], m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) + +!logicalPlan +DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) + DruidSort(fetch=[100], druid=[logical]) + DruidProject(__time=[$0], m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "query", + "query" : { + "queryType" : "scan", + "dataSource" : { + "type" : "table", + "name" : "foo" + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "resultFormat" : "compactedList", + "limit" : 100, + "columns" : [ "__time", "m1" ], + "columnTypes" : [ "LONG", "FLOAT" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "resultFormat" : "compactedList", + "filter" : { + "type" : "or", + "fields" : [ { + "type" : "bound", + "dimension" : "__time", + "lower" : "946684800000", + "upper" : "946771200000", + "upperStrict" : true, + "ordering" : { + "type" : "numeric" + } + }, { + "type" : "bound", + "dimension" : "__time", + "lower" : "978307200000", + "upper" : "978393600000", + "upperStrict" : true, + "ordering" : { + "type" : "numeric" + } + } ] + }, + "columns" : [ "__time", "m1" ], + "columnTypes" : [ "LONG", "FLOAT" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq new file mode 100644 index 000000000000..08aa7cdd3eb8 --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq @@ -0,0 +1,88 @@ +# testTimeFilterOnSubquery@NullHandling=sql case-crc:73448efc +# quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set outputformat mysql +!use druidtest:/// +SELECT __time, m1 FROM (SELECT * FROM "foo" LIMIT 100) +WHERE TIME_IN_INTERVAL(__time, '2000/P1D') OR TIME_IN_INTERVAL(__time, '2001/P1D'); ++-------------------------+-----+ +| __time | m1 | ++-------------------------+-----+ +| 2000-01-01 00:00:00.000 | 1.0 | +| 2001-01-01 00:00:00.000 | 4.0 | ++-------------------------+-----+ +(2 rows) + +!ok +LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) + LogicalSort(fetch=[100]) + LogicalProject(__time=[$0], m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) + +!logicalPlan +DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) + DruidSort(fetch=[100], druid=[logical]) + DruidProject(__time=[$0], m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "query", + "query" : { + "queryType" : "scan", + "dataSource" : { + "type" : "table", + "name" : "foo" + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "resultFormat" : "compactedList", + "limit" : 100, + "columns" : [ "__time", "m1" ], + "columnTypes" : [ "LONG", "FLOAT" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "resultFormat" : "compactedList", + "filter" : { + "type" : "or", + "fields" : [ { + "type" : "range", + "column" : "__time", + "matchValueType" : "LONG", + "lower" : 946684800000, + "upper" : 946771200000, + "upperOpen" : true + }, { + "type" : "range", + "column" : "__time", + "matchValueType" : "LONG", + "lower" : 978307200000, + "upper" : 978393600000, + "upperOpen" : true + } ] + }, + "columns" : [ "__time", "m1" ], + "columnTypes" : [ "LONG", "FLOAT" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq index a893185365e6..8478efa187be 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq @@ -35,8 +35,9 @@ LogicalProject(ranking=[$2], trend_score=[$1]) LogicalSort(fetch=[10]) LogicalWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) LogicalProject(m2=[$1], trend_score=[$2]) - LogicalAggregate(group=[{5, 6}], trend_score=[COUNT()]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0, 1}], trend_score=[COUNT()]) + LogicalProject(m1=[$5], m2=[$6]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) @@ -44,8 +45,9 @@ DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) DruidSort(fetch=[10], druid=[logical]) DruidWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) DruidProject(m2=[$1], trend_score=[$2], druid=[logical]) - DruidAggregate(group=[{5, 6}], trend_score=[COUNT()], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0, 1}], trend_score=[COUNT()], druid=[logical]) + DruidProject(m1=[$5], m2=[$6], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { From 034aeedaad8a638c5affdbba8b75ebb273ad19a1 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Sat, 7 Dec 2024 16:30:22 +0000 Subject: [PATCH 74/99] some progress --- .../sql/calcite/CalciteArraysQueryTest.java | 4 +- .../druid/sql/calcite/DecoupledExtension.java | 10 ++ .../sql/calcite/DecoupledTestConfig.java | 15 +++ .../druid/sql/calcite/NotYetSupported.java | 2 +- ...olumnsArrayColumns@NullHandling=default.iq | 51 ++++---- ...tUnnestWithFilters@NullHandling=default.iq | 92 -------------- .../testUnnestWithFilters@NullHandling=sql.iq | 94 -------------- ...hFiltersInnerLimit@NullHandling=default.iq | 91 -------------- ...tWithFiltersInnerLimit@NullHandling=sql.iq | 93 -------------- ...rsInsideAndOutside@NullHandling=default.iq | 112 ----------------- ...iltersInsideAndOutside@NullHandling=sql.iq | 116 ------------------ ...essionInInnerQuery@NullHandling=default.iq | 12 +- .../testUnnestWithGroupByHavingSelector.iq | 7 +- ...essionInInnerQuery@NullHandling=default.iq | 12 +- 14 files changed, 69 insertions(+), 642 deletions(-) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 3012575b7b35..ae954acac031 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -68,6 +68,7 @@ import org.apache.druid.segment.column.RowSignature; import org.apache.druid.segment.join.JoinType; import org.apache.druid.segment.virtual.ExpressionVirtualColumn; +import org.apache.druid.sql.calcite.DecoupledTestConfig.IgnoreDefaultsReson; import org.apache.druid.sql.calcite.DecoupledTestConfig.IgnoreQueriesReason; import org.apache.druid.sql.calcite.DecoupledTestConfig.QuidemTestCaseReason; import org.apache.druid.sql.calcite.NotYetSupported.Modes; @@ -4686,7 +4687,6 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestCol() } @NotYetSupported(Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumns() { @@ -5310,6 +5310,7 @@ public void testUnnestVirtualWithColumns2() ); } + @DecoupledTestConfig(ignoreDefaultsMode = IgnoreDefaultsReson.UNNEST_EMPTY_DIFFERENCE) @Test public void testUnnestWithFilters() { @@ -5459,6 +5460,7 @@ public void testUnnestWithFiltersInnerLimit() ); } + @DecoupledTestConfig(ignoreDefaultsMode = IgnoreDefaultsReson.UNNEST_EMPTY_DIFFERENCE) @Test public void testUnnestWithFiltersInsideAndOutside() { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java index be9e388fb39e..b121e08c9986 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java @@ -28,6 +28,7 @@ import org.apache.druid.quidem.ProjectPathUtils; import org.apache.druid.server.security.AuthConfig; import org.apache.druid.sql.calcite.BaseCalciteQueryTest.CalciteTestConfig; +import org.apache.druid.sql.calcite.DecoupledTestConfig.IgnoreDefaultsReson; import org.apache.druid.sql.calcite.planner.PlannerConfig; import org.apache.druid.sql.calcite.util.SqlTestFramework; import org.junit.jupiter.api.extension.BeforeEachCallback; @@ -36,6 +37,8 @@ import java.io.File; import java.util.List; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + public class DecoupledExtension implements BeforeEachCallback { private BaseCalciteQueryTest baseTest; @@ -69,6 +72,13 @@ public QueryTestBuilder testBuilder() boolean ignoreQueries = (decTestConfig != null && decTestConfig.ignoreExpectedQueriesReason().isPresent()); + if (NullHandling.replaceWithDefault()) { + assumeTrue( + decTestConfig == null || decTestConfig.ignoreDefaultsMode() == IgnoreDefaultsReson.NONE, + "Disabled beacuse ignoreDefaultsMode specified" + ); + } + CalciteTestConfig testConfig = baseTest.new CalciteTestConfig(CONTEXT_OVERRIDES) { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java index 98a0a54c8224..0a694c6d1c73 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java @@ -47,6 +47,21 @@ */ IgnoreQueriesReason ignoreExpectedQueriesReason() default IgnoreQueriesReason.NONE; + /** + * Ignores defaults mode for the given reason + */ + IgnoreDefaultsReson ignoreDefaultsMode() default IgnoreDefaultsReson.NONE; + + enum IgnoreDefaultsReson { + NONE, + /** + * Decoupled mode avoids unnesting "" in defaults mode + * new Object[]{"a", "[\"a\",\"b\"]"}, + * new Object[]{"a", ""} + */ + UNNEST_EMPTY_DIFFERENCE + } + enum IgnoreQueriesReason { NONE, diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java b/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java index 5ab89388602f..fbd5e8410c10 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java @@ -93,7 +93,7 @@ enum Modes REQUIRE_TIME_CONDITION(CannotBuildQueryException.class, "requireTimeCondition is enabled"), UNNEST_INLINED(Exception.class, "Missing conversion is Uncollect"), UNNEST_RESULT_MISMATCH(AssertionError.class, "(Result count mismatch|column content mismatch)"), - RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS(AssertionError.class, "(Result count mismatch|column content mismatch)"); + RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS(Throwable.class, "(Result count mismatch|column content mismatch|ARRAY)"); // @formatter:on public Class throwableClass; diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq index 41ab9a29c26b..4761aa247fd6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq @@ -92,28 +92,27 @@ org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : Error while e at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) - at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) - at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:95) + at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:91) + at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:60) + at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98) + at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40) + at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529) + at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756) + at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452) + at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210) org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.query.filter.DruidPredicateFactory.makeArrayPredicate(DruidPredicateFactory.java:42) at org.apache.druid.segment.filter.PredicateValueMatcherFactory.makeArrayProcessor(PredicateValueMatcherFactory.java:110) at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:90) - at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:39) + at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:1) at org.apache.druid.segment.ColumnProcessors.makeProcessorInternal(ColumnProcessors.java:290) at org.apache.druid.segment.ColumnProcessors.makeProcessor(ColumnProcessors.java:77) at org.apache.druid.segment.filter.SelectorFilter.makeMatcher(SelectorFilter.java:115) @@ -125,16 +124,16 @@ org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.query.scan.ScanQueryEngine$1.make(ScanQueryEngine.java:143) at org.apache.druid.java.util.common.guava.BaseSequence.toYielder(BaseSequence.java:66) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.query.spec.SpecificSegmentQueryRunner$1.toYielder(SpecificSegmentQueryRunner.java:113) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.query.spec.SpecificSegmentQueryRunner.doNamed(SpecificSegmentQueryRunner.java:185) at org.apache.druid.query.spec.SpecificSegmentQueryRunner$2.wrap(SpecificSegmentQueryRunner.java:165) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) @@ -144,27 +143,27 @@ org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.LazySequence.toYielder(LazySequence.java:46) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.MergeSequence.lambda$toYielder$0(MergeSequence.java:66) + at org.apache.druid.java.util.common.guava.MergeSequence.lambda$1(MergeSequence.java:66) at org.apache.druid.java.util.common.guava.BaseSequence.accumulate(BaseSequence.java:44) at org.apache.druid.java.util.common.guava.MergeSequence.toYielder(MergeSequence.java:63) at org.apache.druid.query.RetryQueryRunner$1.toYielder(RetryQueryRunner.java:133) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.query.CPUTimeMetricQueryRunner$1.wrap(CPUTimeMetricQueryRunner.java:77) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:51) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.Yielders.each(Yielders.java:32) - at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$execute$0(DruidJdbcResultSet.java:239) + at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$0(DruidJdbcResultSet.java:239) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq deleted file mode 100644 index 9356c032797c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=default.iq +++ /dev/null @@ -1,92 +0,0 @@ -# testUnnestWithFilters@NullHandling=default case-crc:810b3e0d -# quidem testcase reason: UNNEST_EXTRA_SCAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM (select * from druid.numfoo where dim2='a'), UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3); -+----+ -| d3 | -+----+ -| a | -| b | -+----+ -(2 rows) - -!ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)]) - LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) - LogicalFilter(condition=[=($2, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)]) - DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) - DruidFilter(condition=[=($2, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'a'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - }, - "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "dbl1", "dbl2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "DOUBLE", "DOUBLE", "FLOAT", "FLOAT", "LONG", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq deleted file mode 100644 index 19a176b8f82b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFilters@NullHandling=sql.iq +++ /dev/null @@ -1,94 +0,0 @@ -# testUnnestWithFilters@NullHandling=sql case-crc:810b3e0d -# quidem testcase reason: UNNEST_EXTRA_SCAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM (select * from druid.numfoo where dim2='a'), UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3); -+----+ -| d3 | -+----+ -| | -| a | -| b | -+----+ -(3 rows) - -!ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)]) - LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) - LogicalFilter(condition=[=($2, 'a')]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)]) - DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) - DruidFilter(condition=[=($2, 'a')]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'a'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "equals", - "column" : "dim2", - "matchValueType" : "STRING", - "matchValue" : "a" - }, - "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "dbl1", "dbl2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "DOUBLE", "DOUBLE", "FLOAT", "FLOAT", "LONG", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq deleted file mode 100644 index 7c1b6965277e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=default.iq +++ /dev/null @@ -1,91 +0,0 @@ -# testUnnestWithFiltersInnerLimit@NullHandling=default case-crc:1f5acfc8 -# quidem testcase reason: UNUSED_VIRTUALCOLUMN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM (select dim2,dim3 from druid.numfoo where dim2='a' LIMIT 2), UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3); -+----+ -| d3 | -+----+ -| a | -| b | -+----+ -(2 rows) - -!ok -LogicalProject(d3=[$1]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) - LogicalProject(dim3=[$1]) - LogicalSort(fetch=[2]) - LogicalFilter(condition=[=($0, 'a')]) - LogicalProject(dim2=[$2], dim3=[$3]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$1], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) - DruidProject(dim3=[$1], druid=[logical]) - DruidSort(fetch=[2], druid=[logical]) - DruidFilter(condition=[=($0, 'a')]) - DruidProject(dim2=[$2], dim3=[$3], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 2, - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - }, - "columns" : [ "dim3" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq deleted file mode 100644 index 93462251588a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit@NullHandling=sql.iq +++ /dev/null @@ -1,93 +0,0 @@ -# testUnnestWithFiltersInnerLimit@NullHandling=sql case-crc:1f5acfc8 -# quidem testcase reason: UNUSED_VIRTUALCOLUMN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM (select dim2,dim3 from druid.numfoo where dim2='a' LIMIT 2), UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3); -+----+ -| d3 | -+----+ -| | -| a | -| b | -+----+ -(3 rows) - -!ok -LogicalProject(d3=[$1]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) - LogicalProject(dim3=[$1]) - LogicalSort(fetch=[2]) - LogicalFilter(condition=[=($0, 'a')]) - LogicalProject(dim2=[$2], dim3=[$3]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$1], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) - DruidProject(dim3=[$1], druid=[logical]) - DruidSort(fetch=[2], druid=[logical]) - DruidFilter(condition=[=($0, 'a')]) - DruidProject(dim2=[$2], dim3=[$3], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 2, - "filter" : { - "type" : "equals", - "column" : "dim2", - "matchValueType" : "STRING", - "matchValue" : "a" - }, - "columns" : [ "dim3" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq deleted file mode 100644 index 97b2692b1045..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=default.iq +++ /dev/null @@ -1,112 +0,0 @@ -# testUnnestWithFiltersInsideAndOutside@NullHandling=default case-crc:10c26262 -# quidem testcase reason: UNNEST_EXTRA_SCAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM - (select * from druid.numfoo where dim2='a') as t, - UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) -WHERE t.dim1 <> 'foo' -AND unnested.d3 <> 'b'; -+----+ -| d3 | -+----+ -| a | -+----+ -(1 row) - -!ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'b')]) - LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) - LogicalFilter(condition=[AND(=($2, 'a'), <>($1, 'foo'))]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'b')]) - DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) - DruidFilter(condition=[AND(=($2, 'a'), <>($1, 'foo'))]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'a'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - }, { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "foo" - } - } ] - }, - "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "dbl1", "dbl2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "DOUBLE", "DOUBLE", "FLOAT", "FLOAT", "LONG", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "b" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq deleted file mode 100644 index a335a370acd8..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInsideAndOutside@NullHandling=sql.iq +++ /dev/null @@ -1,116 +0,0 @@ -# testUnnestWithFiltersInsideAndOutside@NullHandling=sql case-crc:10c26262 -# quidem testcase reason: UNNEST_EXTRA_SCAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3 FROM - (select * from druid.numfoo where dim2='a') as t, - UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3) -WHERE t.dim1 <> 'foo' -AND unnested.d3 <> 'b'; -+----+ -| d3 | -+----+ -| | -| a | -+----+ -(2 rows) - -!ok -LogicalProject(d3=[$18]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'b')]) - LogicalProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0]) - LogicalFilter(condition=[AND(=($2, 'a'), <>($1, 'foo'))]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidProject(d3=[$18], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[<>($0, 'b')]) - DruidProject(__time=[$0], dim1=[$1], $f2=[CAST('a':VARCHAR):VARCHAR], dim3=[$3], dim4=[$4], dim5=[$5], dim6=[$6], dbl1=[$7], dbl2=[$8], f1=[$9], f2=[$10], l1=[$11], l2=[$12], cnt=[$13], m1=[$14], m2=[$15], unique_dim1=[$16], __time0=[$0], druid=[logical]) - DruidFilter(condition=[AND(=($2, 'a'), <>($1, 'foo'))]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'a'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "and", - "fields" : [ { - "type" : "equals", - "column" : "dim2", - "matchValueType" : "STRING", - "matchValue" : "a" - }, { - "type" : "not", - "field" : { - "type" : "equals", - "column" : "dim1", - "matchValueType" : "STRING", - "matchValue" : "foo" - } - } ] - }, - "columns" : [ "__time", "dim1", "v0", "dim3", "dim4", "dim5", "dim6", "dbl1", "dbl2", "f1", "f2", "l1", "l2", "cnt", "m1", "m2", "unique_dim1" ], - "columnTypes" : [ "LONG", "STRING", "STRING", "STRING", "STRING", "STRING", "STRING", "DOUBLE", "DOUBLE", "FLOAT", "FLOAT", "LONG", "LONG", "LONG", "FLOAT", "DOUBLE", "COMPLEX" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "not", - "field" : { - "type" : "equals", - "column" : "j0.unnest", - "matchValueType" : "STRING", - "matchValue" : "b" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "j0.unnest" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq index 05790207aa95..de2e331b37a3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersWithExpressionInInnerQuery@NullHandling=default.iq @@ -19,16 +19,16 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (2 rows) !ok -LogicalProject(t=[$0], d3=[$3]) +LogicalProject(t=[$0], d3=[$2]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3]) LogicalFilter(condition=[=($2, 'a')]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$3], druid=[logical]) +DruidProject(t=[$0], d3=[$2], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0], druid=[logical]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], druid=[logical]) DruidFilter(condition=[=($2, 'a')]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -61,8 +61,8 @@ DruidProject(t=[$0], d3=[$3], druid=[logical]) "dimension" : "dim2", "value" : "a" }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0", "dim3" ], + "columnTypes" : [ "LONG", "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq index 26485b8d1e42..d0846d3cad30 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq @@ -45,10 +45,9 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "equals", - "column" : "j0.unnest", - "matchValueType" : "STRING", - "matchValue" : "b" + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "b" } }, "intervals" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq index 9b9802c0645b..8b64c5e5f03e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithInFiltersWithExpressionInInnerQuery@NullHandling=default.iq @@ -19,16 +19,16 @@ SELECT t,d3 FROM (select FLOOR(__time to hour) t, dim3 from druid.numfoo where d (2 rows) !ok -LogicalProject(t=[$0], d3=[$3]) +LogicalProject(t=[$0], d3=[$2]) LogicalUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0]) + LogicalProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3]) LogicalFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan -DruidProject(t=[$0], d3=[$3], druid=[logical]) +DruidProject(t=[$0], d3=[$2], druid=[logical]) DruidUnnest(unnestExpr=[MV_TO_ARRAY($1)]) - DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], __time=[$0], druid=[logical]) + DruidProject($f0=[FLOOR($0, FLAG(HOUR))], dim3=[$3], druid=[logical]) DruidFilter(condition=[SEARCH($2, Sarg['a':VARCHAR, 'b':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) @@ -61,8 +61,8 @@ DruidProject(t=[$0], d3=[$3], druid=[logical]) "dimension" : "dim2", "values" : [ "a", "b" ] }, - "columns" : [ "v0", "dim3", "__time" ], - "columnTypes" : [ "LONG", "STRING", "LONG" ], + "columns" : [ "v0", "dim3" ], + "columnTypes" : [ "LONG", "STRING" ], "granularity" : { "type" : "all" }, From 48032cec436e77e7642009e5d179ef60da051efd Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Sat, 7 Dec 2024 16:35:47 +0000 Subject: [PATCH 75/99] fixup --- .../org/apache/druid/sql/calcite/DecoupledTestConfig.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java index 0a694c6d1c73..d720e22a3633 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java @@ -52,12 +52,16 @@ */ IgnoreDefaultsReson ignoreDefaultsMode() default IgnoreDefaultsReson.NONE; - enum IgnoreDefaultsReson { + enum IgnoreDefaultsReson + { NONE, /** * Decoupled mode avoids unnesting "" in defaults mode + * + *
      * new Object[]{"a", "[\"a\",\"b\"]"},
      * new Object[]{"a", ""}
+     * 
*/ UNNEST_EMPTY_DIFFERENCE } From fa96b15f05e8b1a37e72b52c8395cc5fd8805236 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Sat, 7 Dec 2024 16:37:18 +0000 Subject: [PATCH 76/99] fix? --- ...ndOtherAggregators@NullHandling=default.iq | 10 +++---- ...PushdownExtraction@NullHandling=default.iq | 14 ++++----- ...estGroupByWithLiteralInSubqueryGrouping.iq | 2 +- ...gregatorsUsingJoin@NullHandling=default.iq | 30 ++++++++----------- ...ingWithScanAndSort@NullHandling=default.iq | 10 +++---- 5 files changed, 27 insertions(+), 39 deletions(-) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq index e4645bff7d32..70979223a8e8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testExactCountDistinctWithGroupingAndOtherAggregators@NullHandling=default.iq @@ -21,15 +21,13 @@ SELECT dim2, SUM(cnt), COUNT(distinct dim1) FROM druid.foo GROUP BY dim2; !ok LogicalAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{0, 1}], EXPR$1=[SUM($2)]) - LogicalProject(dim1=[$1], dim2=[$2], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1, 2}], EXPR$1=[SUM($4)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[SUM($2)], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$1=[SUM($2)], druid=[logical]) - DruidProject(dim1=[$1], dim2=[$2], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1, 2}], EXPR$1=[SUM($4)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq index 71b6867f5ced..ee8ff3e4ed42 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByLimitPushdownExtraction@NullHandling=default.iq @@ -21,19 +21,17 @@ SELECT dim4, substring(dim5, 1, 1), count(*) FROM druid.numfoo WHERE dim4 = 'a' LogicalProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1]) LogicalSort(fetch=[2]) LogicalAggregate(group=[{0}], EXPR$2=[COUNT()]) - LogicalProject(EXPR$1=[SUBSTRING($1, 1, 1)]) - LogicalFilter(condition=[=($0, 'a')]) - LogicalProject(dim4=[$4], dim5=[$5]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalProject(EXPR$1=[SUBSTRING($5, 1, 1)]) + LogicalFilter(condition=[=($4, 'a')]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidProject(dim4=[CAST('a':VARCHAR):VARCHAR], EXPR$1=[$0], EXPR$2=[$1], druid=[logical]) DruidSort(fetch=[2], druid=[logical]) DruidAggregate(group=[{0}], EXPR$2=[COUNT()], druid=[logical]) - DruidProject(EXPR$1=[SUBSTRING($1, 1, 1)], druid=[logical]) - DruidFilter(condition=[=($0, 'a')]) - DruidProject(dim4=[$4], dim5=[$5], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidProject(EXPR$1=[SUBSTRING($5, 1, 1)], druid=[logical]) + DruidFilter(condition=[=($4, 'a')]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq index 65cce7cc14b4..da905b0336c1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq @@ -30,8 +30,8 @@ SELECT +-------+----+ | t1 | t2 | +-------+----+ -| dummy | b | | dummy | | +| dummy | b | +-------+----+ (2 rows) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq index 6231ea35d4a6..092819fbb036 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin@NullHandling=default.iq @@ -23,33 +23,27 @@ SELECT dim2, COUNT(*), COUNT(distinct dim1), COUNT(distinct cnt) FROM druid.foo LogicalProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) LogicalJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) - LogicalProject(dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{2}], EXPR$1=[COUNT()]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{1}], EXPR$2=[COUNT($0)]) - LogicalAggregate(group=[{0, 1}]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], EXPR$3=[COUNT()]) - LogicalAggregate(group=[{0, 1}]) - LogicalProject(dim2=[$2], cnt=[$4]) + LogicalAggregate(group=[{1, 2}]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{0}], EXPR$3=[COUNT()]) + LogicalAggregate(group=[{2, 4}]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5], druid=[logical]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $4)], joinType=[inner]) DruidJoin(condition=[IS NOT DISTINCT FROM($0, $2)], joinType=[inner]) - DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) - DruidProject(dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{2}], EXPR$1=[COUNT()], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{1}], EXPR$2=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{0, 1}], druid=[logical]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], EXPR$3=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0, 1}], druid=[logical]) - DruidProject(dim2=[$2], cnt=[$4], druid=[logical]) + DruidAggregate(group=[{1, 2}], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{0}], EXPR$3=[COUNT()], druid=[logical]) + DruidAggregate(group=[{2, 4}], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq index 8478efa187be..a893185365e6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testWindowingWithScanAndSort@NullHandling=default.iq @@ -35,9 +35,8 @@ LogicalProject(ranking=[$2], trend_score=[$1]) LogicalSort(fetch=[10]) LogicalWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) LogicalProject(m2=[$1], trend_score=[$2]) - LogicalAggregate(group=[{0, 1}], trend_score=[COUNT()]) - LogicalProject(m1=[$5], m2=[$6]) - LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{5, 6}], trend_score=[COUNT()]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) @@ -45,9 +44,8 @@ DruidProject(ranking=[$2], trend_score=[$1], druid=[logical]) DruidSort(fetch=[10], druid=[logical]) DruidWindow(window#0=[window(partition {0} order by [0] aggs [RANK()])]) DruidProject(m2=[$1], trend_score=[$2], druid=[logical]) - DruidAggregate(group=[{0, 1}], trend_score=[COUNT()], druid=[logical]) - DruidProject(m1=[$5], m2=[$6], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{5, 6}], trend_score=[COUNT()], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { From a830e97c90d2be37324fa32a83151bacf2c73ab0 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Sat, 7 Dec 2024 16:50:18 +0000 Subject: [PATCH 77/99] uipdate --- .../sql/calcite/CalciteArraysQueryTest.java | 2 +- .../sql/calcite/CalciteJoinQueryTest.java | 3 +- .../sql/calcite/DecoupledTestConfig.java | 6 +++- .../testUnnestWithGroupByHavingSelector.iq | 7 +++-- ...InnerJoinWithLimit@NullHandling=default.iq | 14 ++++------ ...urces@all_disabled@NullHandling=default.iq | 14 ++++------ ...ources@all_enabled@NullHandling=default.iq | 14 ++++------ ...ataSources@default@NullHandling=default.iq | 14 ++++------ ...ue-column_disabled@NullHandling=default.iq | 14 ++++------ ...-rewrites-disabled@NullHandling=default.iq | 14 ++++------ ...es@filter-rewrites@NullHandling=default.iq | 14 ++++------ ...ces@join-to-filter@NullHandling=default.iq | 14 ++++------ ...ccess@all_disabled@NullHandling=default.iq | 14 ++++------ ...Access@all_enabled@NullHandling=default.iq | 14 ++++------ ...rectAccess@default@NullHandling=default.iq | 14 ++++------ ...ue-column_disabled@NullHandling=default.iq | 14 ++++------ ...-rewrites-disabled@NullHandling=default.iq | 14 ++++------ ...ss@filter-rewrites@NullHandling=default.iq | 14 ++++------ ...ess@join-to-filter@NullHandling=default.iq | 14 ++++------ ...ccess@all_disabled@NullHandling=default.iq | 14 ++++------ ...Access@all_enabled@NullHandling=default.iq | 14 ++++------ ...rectAccess@default@NullHandling=default.iq | 14 ++++------ ...ue-column_disabled@NullHandling=default.iq | 14 ++++------ ...-rewrites-disabled@NullHandling=default.iq | 14 ++++------ ...ss@filter-rewrites@NullHandling=default.iq | 14 ++++------ ...ess@join-to-filter@NullHandling=default.iq | 14 ++++------ ...sults@all_disabled@NullHandling=default.iq | 26 ++++++++--------- ...esults@all_enabled@NullHandling=default.iq | 26 ++++++++--------- ...ptyResults@default@NullHandling=default.iq | 26 ++++++++--------- ...ue-column_disabled@NullHandling=default.iq | 26 ++++++++--------- ...-rewrites-disabled@NullHandling=default.iq | 26 ++++++++--------- ...ts@filter-rewrites@NullHandling=default.iq | 26 ++++++++--------- ...lts@join-to-filter@NullHandling=default.iq | 26 ++++++++--------- ...sults@all_disabled@NullHandling=default.iq | 26 ++++++++--------- ...esults@all_enabled@NullHandling=default.iq | 26 ++++++++--------- ...ptyResults@default@NullHandling=default.iq | 26 ++++++++--------- ...ue-column_disabled@NullHandling=default.iq | 26 ++++++++--------- ...-rewrites-disabled@NullHandling=default.iq | 26 ++++++++--------- ...ts@filter-rewrites@NullHandling=default.iq | 26 ++++++++--------- ...lts@join-to-filter@NullHandling=default.iq | 26 ++++++++--------- ...ilter@all_disabled@NullHandling=default.iq | 20 ++++++------- ...Filter@all_enabled@NullHandling=default.iq | 20 ++++++------- ...NullFilter@default@NullHandling=default.iq | 20 ++++++------- ...ue-column_disabled@NullHandling=default.iq | 20 ++++++------- ...-rewrites-disabled@NullHandling=default.iq | 20 ++++++------- ...er@filter-rewrites@NullHandling=default.iq | 20 ++++++------- ...ter@join-to-filter@NullHandling=default.iq | 20 ++++++------- ...iesWithFloorOnTime@NullHandling=default.iq | 14 ++++------ ...gateMultipleValues@NullHandling=default.iq | 14 ++++------ ...iesWithFloorOnTime@NullHandling=default.iq | 14 ++++------ ...ccess@all_disabled@NullHandling=default.iq | 14 ++++------ ...Access@all_enabled@NullHandling=default.iq | 14 ++++------ ...rectAccess@default@NullHandling=default.iq | 14 ++++------ ...ue-column_disabled@NullHandling=default.iq | 14 ++++------ ...-rewrites-disabled@NullHandling=default.iq | 14 ++++------ ...ss@filter-rewrites@NullHandling=default.iq | 14 ++++------ ...ess@join-to-filter@NullHandling=default.iq | 14 ++++------ ...ccess@all_disabled@NullHandling=default.iq | 12 +++----- ...Access@all_enabled@NullHandling=default.iq | 12 +++----- ...rectAccess@default@NullHandling=default.iq | 12 +++----- ...ue-column_disabled@NullHandling=default.iq | 12 +++----- ...-rewrites-disabled@NullHandling=default.iq | 12 +++----- ...ss@filter-rewrites@NullHandling=default.iq | 12 +++----- ...ess@join-to-filter@NullHandling=default.iq | 12 +++----- ...ccess@all_disabled@NullHandling=default.iq | 14 ++++------ ...Access@all_enabled@NullHandling=default.iq | 14 ++++------ ...rectAccess@default@NullHandling=default.iq | 14 ++++------ ...ue-column_disabled@NullHandling=default.iq | 14 ++++------ ...-rewrites-disabled@NullHandling=default.iq | 14 ++++------ ...ss@filter-rewrites@NullHandling=default.iq | 14 ++++------ ...ess@join-to-filter@NullHandling=default.iq | 14 ++++------ ...ilter@all_disabled@NullHandling=default.iq | 20 ++++++------- ...Filter@all_enabled@NullHandling=default.iq | 20 ++++++------- ...WithFilter@default@NullHandling=default.iq | 20 ++++++------- ...ue-column_disabled@NullHandling=default.iq | 20 ++++++------- ...-rewrites-disabled@NullHandling=default.iq | 20 ++++++------- ...er@filter-rewrites@NullHandling=default.iq | 20 ++++++------- ...ter@join-to-filter@NullHandling=default.iq | 20 ++++++------- ...Joins@all_disabled@NullHandling=default.iq | 20 ++++++------- ...tJoins@all_enabled@NullHandling=default.iq | 20 ++++++------- ...licitJoins@default@NullHandling=default.iq | 20 ++++++------- ...ue-column_disabled@NullHandling=default.iq | 20 ++++++------- ...-rewrites-disabled@NullHandling=default.iq | 20 ++++++------- ...ns@filter-rewrites@NullHandling=default.iq | 20 ++++++------- ...ins@join-to-filter@NullHandling=default.iq | 20 ++++++------- ...query@all_disabled@NullHandling=default.iq | 26 +++++++---------- ...bquery@all_enabled@NullHandling=default.iq | 26 +++++++---------- ...InSubquery@default@NullHandling=default.iq | 26 +++++++---------- ...ue-column_disabled@NullHandling=default.iq | 26 +++++++---------- ...-rewrites-disabled@NullHandling=default.iq | 26 +++++++---------- ...ry@filter-rewrites@NullHandling=default.iq | 26 +++++++---------- ...ery@join-to-filter@NullHandling=default.iq | 26 +++++++---------- ...gregateWithOrderBy@NullHandling=default.iq | 22 +++++++-------- ...terTimeExtractScan@NullHandling=default.iq | 22 +++++++-------- ...ously@all_disabled@NullHandling=default.iq | 28 ++++++++----------- ...eously@all_enabled@NullHandling=default.iq | 28 ++++++++----------- ...ltaneously@default@NullHandling=default.iq | 28 ++++++++----------- ...ue-column_disabled@NullHandling=default.iq | 28 ++++++++----------- ...-rewrites-disabled@NullHandling=default.iq | 28 ++++++++----------- ...ly@filter-rewrites@NullHandling=default.iq | 28 ++++++++----------- ...sly@join-to-filter@NullHandling=default.iq | 28 ++++++++----------- ...ilter@all_disabled@NullHandling=default.iq | 22 +++++++-------- ...Filter@all_enabled@NullHandling=default.iq | 22 +++++++-------- ...fAndFilter@default@NullHandling=default.iq | 22 +++++++-------- ...ue-column_disabled@NullHandling=default.iq | 22 +++++++-------- ...-rewrites-disabled@NullHandling=default.iq | 22 +++++++-------- ...er@filter-rewrites@NullHandling=default.iq | 22 +++++++-------- ...ter@join-to-filter@NullHandling=default.iq | 22 +++++++-------- ...onFns@all_disabled@NullHandling=default.iq | 14 ++++------ ...ionFns@all_enabled@NullHandling=default.iq | 14 ++++------ ...ractionFns@default@NullHandling=default.iq | 14 ++++------ ...ue-column_disabled@NullHandling=default.iq | 14 ++++------ ...-rewrites-disabled@NullHandling=default.iq | 14 ++++------ ...ns@filter-rewrites@NullHandling=default.iq | 14 ++++------ ...Fns@join-to-filter@NullHandling=default.iq | 14 ++++------ 115 files changed, 909 insertions(+), 1197 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index ae954acac031..f062822a9ff4 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4686,7 +4686,7 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestCol() ); } - @NotYetSupported(Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumns() { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java index 02a1a3fe2816..4d8811cb2da4 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java @@ -6128,9 +6128,8 @@ public void testJoinsWithThreeConditions() ) ); } - +// @Test - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS, separateDefaultModeTest = true) public void testJoinWithInputRefCondition() { cannotVectorize(); diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java index d720e22a3633..353071441af9 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java @@ -63,7 +63,11 @@ enum IgnoreDefaultsReson * new Object[]{"a", ""} * */ - UNNEST_EMPTY_DIFFERENCE + UNNEST_EMPTY_DIFFERENCE, + /** + * + */ + UNNEST_ARRAY_ISSUE } enum IgnoreQueriesReason diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq index d0846d3cad30..26485b8d1e42 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq @@ -45,9 +45,10 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "b" + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "b" } }, "intervals" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq index 722ef1de9af2..d2f2548b675a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testExactTopNOnInnerJoinWithLimit@NullHandling=default.iq @@ -25,10 +25,9 @@ LogicalSort(fetch=[1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim4=[$4], m1=[$14]) LogicalTableScan(table=[[druid, numfoo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, 'a')]) - LogicalProject(dim4=[$4]) - LogicalTableScan(table=[[druid, numfoo]]) + LogicalAggregate(group=[{4}]) + LogicalFilter(condition=[<>($4, 'a')]) + LogicalTableScan(table=[[druid, numfoo]]) !logicalPlan DruidSort(fetch=[1], druid=[logical]) @@ -36,10 +35,9 @@ DruidSort(fetch=[1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim4=[$4], m1=[$14], druid=[logical]) DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, 'a')]) - DruidProject(dim4=[$4], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + DruidAggregate(group=[{4}], druid=[logical]) + DruidFilter(condition=[<>($4, 'a')]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq index a22c4c162800..699b9c230520 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_disabled@NullHandling=default.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq index 5073aec32075..559eadb36320 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@all_enabled@NullHandling=default.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq index f9f2462bde26..b6c55a471df1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@default@NullHandling=default.iq @@ -28,10 +28,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq index 48deebbf17fc..fd3f5b44f810 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-on-value-column_disabled@NullHandling=default.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq index d37099308d86..05bc33e20708 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites-disabled@NullHandling=default.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq index 2f559632abca..f554299bc8be 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@filter-rewrites@NullHandling=default.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq index 2b56c56248cb..ede90bee602d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testGroupByOverGroupByOverInnerJoinOnTwoInlineDataSources@join-to-filter@NullHandling=default.iq @@ -31,10 +31,9 @@ LogicalAggregate(group=[{0}]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -44,10 +43,9 @@ DruidAggregate(group=[{0}], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq index 0f662bd1aed3..6a7c709365b9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq index b2bcb7177692..4829e9398151 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq index 09ce7787fb80..587178dde591 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq @@ -27,10 +27,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -38,10 +37,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq index e213a2a5c350..d33427702e8b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq index fbbaf340ee99..3a5f56259901 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq index 09b51f79ef38..5cfae3e4b94a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq index ff312797eec8..758f4c48bf4d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq index bd58defdb6d6..24f52e8a1c0d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq index db9e70b45fa3..8151cc91a3ae 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq index d598bc106612..87d1ef730e79 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq @@ -27,10 +27,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -38,10 +37,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq index db9e3b83a213..2c622d5977fc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq index 59f846f6a407..d5d73892fc1a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq index eafaff6806a3..3efe170e8085 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq index 06fa411810a6..1bd6a87b9a07 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq index aa37bd300eff..6d38d618c09a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -227,8 +225,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq index f157cad2924f..3e2060932575 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -227,8 +225,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq index ba86267509c3..02e31c756165 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq @@ -20,22 +20,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -224,8 +222,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq index 76bfe6dcd33b..b6f2366335a7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -227,8 +225,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq index 03b29f1cd24a..ba5f8f1c947b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -227,8 +225,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq index 5d5cdf00e572..dcd84ca7f3cc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -227,8 +225,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq index 206049e87fe0..c2d5190ae651 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq @@ -23,22 +23,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C' (0 rows) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, 'A'), =($1, 'B')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -227,8 +225,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq index 8190d2d01e32..1c4316892170 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -228,8 +226,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq index f465747dcb1c..9548e169cfa7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -228,8 +226,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq index 9a6d6b99c771..08ae66426305 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq @@ -21,22 +21,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -225,8 +223,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq index 4b34d9f112bf..1332196099e6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -228,8 +226,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq index 69a3f68d7a40..c2482d015872 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -228,8 +226,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq index a917edeea1b9..d1e4c352a62c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -228,8 +226,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq index 5d596d102bd6..1c471e3a125c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq @@ -24,22 +24,20 @@ INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C' (1 row) !ok -LogicalProject(m1=[$2], m10=[$3]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - LogicalProject(dim1=[$1], dim2=[$2], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) +LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(m1=[$5]) + LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) LogicalTableScan(table=[[druid, foo]]) + LogicalProject(m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan -DruidProject(m1=[$2], m10=[$3], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[OR(AND(=($0, '1'), =($1, 'a')), AND(=($0, 'C'), =($1, 'D')), AND(=($0, 'A'), =($1, 'C')), AND(=($0, 'C'), =($1, 'E')), AND(=($0, 'D'), =($1, 'H')), AND(=($0, 'A'), =($1, 'D')), AND(=($0, 'B'), =($1, 'C')), AND(=($0, 'H'), =($1, 'E')), AND(=($0, 'I'), =($1, 'J')), AND(=($0, 'I'), =($1, 'K')), AND(=($0, 'J'), =($1, 'I')), AND(=($0, 'Q'), =($1, 'R')), AND(=($0, 'Q'), =($1, 'S')), AND(=($0, 'S'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'Y')), AND(=($0, 'Z'), =($1, 'U')), AND(=($0, 'U'), =($1, 'Z')), AND(=($0, 'P'), =($1, 'Q')), AND(=($0, 'X'), =($1, 'A')))]) - DruidProject(dim1=[$1], dim2=[$2], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) +DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(m1=[$5], druid=[logical]) + DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { @@ -228,8 +226,8 @@ DruidProject(m1=[$2], m10=[$3], druid=[logical]) } ] } ] }, - "columns" : [ "dim1", "dim2", "m1" ], - "columnTypes" : [ "STRING", "STRING", "FLOAT" ], + "columns" : [ "m1" ], + "columnTypes" : [ "FLOAT" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default.iq index 91325d00f580..dc0273128f44 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -58,8 +58,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "dimension" : "dim2", "value" : null }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default.iq index b786ccdd1b9e..3906275369cf 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -58,8 +58,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "dimension" : "dim2", "value" : null }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=default.iq index 1e16acec1d99..0bda4620a77b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=default.iq @@ -17,18 +17,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -55,8 +55,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "dimension" : "dim2", "value" : null }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default.iq index cb40c7f8f5fc..35732a7970bc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -58,8 +58,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "dimension" : "dim2", "value" : null }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default.iq index 10746f2a1122..844b9a7673c3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -58,8 +58,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "dimension" : "dim2", "value" : null }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default.iq index e3ba40f56d1b..588e166b78c4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -58,8 +58,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "dimension" : "dim2", "value" : null }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default.iq index c0b7ca271a3d..97e953c9af72 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default.iq @@ -20,18 +20,18 @@ SELECT dim1, l.v from druid.foo f inner join lookup.lookyloo l on f.dim1 = l.k w (1 row) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) +LogicalProject(dim1=[$0], v=[$2]) + LogicalJoin(condition=[=($0, $1)], joinType=[inner]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[IS NULL($2)]) LogicalTableScan(table=[[druid, foo]]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) +DruidProject(dim1=[$0], v=[$2], druid=[logical]) + DruidJoin(condition=[=($0, $1)], joinType=[inner]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[IS NULL($2)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) @@ -58,8 +58,8 @@ DruidProject(dim1=[$0], v=[$3], druid=[logical]) "dimension" : "dim2", "value" : null }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], + "columns" : [ "dim1" ], + "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq index ae408515be44..c08b970f1617 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTime@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2]) - LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5]) + LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)], druid=[logical]) @@ -42,10 +41,9 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2], druid=[logical]) - DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical]) + DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq index 82d9238cac8c..2f78608ebffd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnGroupByInsteadOfTimeseriesWithFloorOnTimeWithNoAggregateMultipleValues@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2]) - LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5]) + LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) @@ -42,10 +41,9 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$2], druid=[logical]) - DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[+(CAST(TIME_FLOOR($0, 'PT1H')):BIGINT NOT NULL, 1)], m1=[$5], druid=[logical]) + DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq index 998c9712b196..f2275d4db00f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinOnTimeseriesWithFloorOnTime@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)]) LogicalProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}], t2=[MIN($1)]) - LogicalProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$2]) - LogicalFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - LogicalProject(__time=[$0], dim3=[$3], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5]) + LogicalFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) @@ -42,10 +41,9 @@ DruidAggregate(group=[{0, 1}], EXPR$2=[ANY_VALUE($2, $3, $4)], druid=[logical]) DruidProject(__time=[$0], dim3=[$3], m1=[$5], $f3=[TIME_FLOOR($0, 'PT1H')], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], t2=[MIN($1)], druid=[logical]) - DruidProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$2], druid=[logical]) - DruidFilter(condition=[AND(=($1, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) - DruidProject(__time=[$0], dim3=[$3], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(t1=[TIME_FLOOR($0, 'PT1H')], m1=[$5], druid=[logical]) + DruidFilter(condition=[AND(=($3, 'b'), SEARCH($0, Sarg[[1994-04-29 00:00:00:TIMESTAMP(3)..2020-01-11 00:00:00:TIMESTAMP(3)]]:TIMESTAMP(3)))]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq index 37698f164443..2f4290fed6de 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq index bbd8cacac851..27d860eb9f04 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@all_enabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq index 4284c0b3f3c6..845d81b6a3fc 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@default@NullHandling=default.iq @@ -27,10 +27,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -38,10 +37,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq index d35be8886830..8f7728670181 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq index 84fa5a7112f2..eaf39cc2e5a8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq index 02215c6bf087..fe73169674d1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq index ffc5803e0aed..0e75a816828a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithOuterWhere_withLeftDirectAccess@join-to-filter@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq index 67538eabd4ec..9856d6880d74 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_disabled@NullHandling=default.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq index 76818f89b159..dd18a691b267 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@all_enabled@NullHandling=default.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq index a9e04727d846..dd0fe8341b5d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@default@NullHandling=default.iq @@ -27,24 +27,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq index 3f971a6a09ed..22719f86aea2 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq index 569446f1bf4a..de427c4ece07 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq index e9034a647525..7973786f10ec 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq index 0ca14134123e..c1b280b3803c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSourcesWithTimeFilter_withLeftDirectAccess@join-to-filter@NullHandling=default.iq @@ -30,24 +30,20 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR]) LogicalFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], druid=[logical]) DruidFilter(condition=[AND(=($1, '10.1'), >=($0, 1999-01-01 00:00:00))]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq index 6a20a8919ffa..9149b1cebb62 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq index 3e87fc451660..ba5ed17c9e7e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@all_enabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq index 07ef05d87c8b..fd632f528467 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@default@NullHandling=default.iq @@ -27,10 +27,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -38,10 +37,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq index 083244330bba..eb287c5eeedd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq index dd8150e964fb..e36e08bdf07d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites-disabled@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq index 3a6b73d1f321..6d586cb7eebd 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@filter-rewrites@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq index dd79b380268e..e108a87115d4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testLeftJoinOnTwoInlineDataSources_withLeftDirectAccess@join-to-filter@NullHandling=default.iq @@ -30,10 +30,9 @@ LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[left]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) - LogicalFilter(condition=[=($0, '10.1')]) - LogicalProject(dim1=[$1]) + LogicalTableScan(table=[[druid, foo]]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan @@ -41,10 +40,9 @@ DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[left]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidFilter(condition=[=($0, '10.1')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, '10.1')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq index d3b2624ac8db..7740a7ad6807 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq index 58349526e65a..c9534c261147 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq index 50f43d1331c0..c1442a01a12c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq @@ -21,30 +21,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq index 58117eb96461..8d0e1e90586a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq index d5dcf636a064..c73504a79e83 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq index 7a6c7da8e261..49b7282e0e54 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq index 021299b669d9..cf49a5aa1b63 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq @@ -24,30 +24,26 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) LogicalAggregate(group=[{0}]) LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1]) + LogicalProject(dim1=[$1]) + LogicalFilter(condition=[=($1, 'def')]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], druid=[logical]) + DruidProject(dim1=[$1], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq index 45ebc7ad6302..6f486b9f9479 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq index 4e6351576244..654255be07f9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq index ce8035ca10d4..68151dd0ad2c 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq @@ -27,30 +27,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq index e38ba8480aa8..1531c7a112b0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq index e6b11a3e1a6f..f26d2df4004b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq index 9afd0d09c7fc..f878990edca7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq index 9b1014830020..1ec4e43d4e7f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq @@ -30,30 +30,26 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalFilter(condition=[IS NULL($3)]) LogicalJoin(condition=[=($3, $0)], joinType=[left]) LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalProject(__time=[$0]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], t=[MIN($0)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidFilter(condition=[IS NULL($3)]) DruidJoin(condition=[=($0, $3)], joinType=[left]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq index 0b18ee748790..f1bb433af1e6 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq index 41352425a130..3ddf82c80826 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq index 95185830cb41..394eae7d0cec 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq @@ -27,20 +27,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -48,20 +45,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq index 70ece273d012..5ca847ef2d70 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq index a0796fc92672..148018b20ab7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq index be69252c978f..c4917af008d7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq index dbcb2cefd1ce..bce9e35ff71b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq @@ -30,20 +30,17 @@ LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $5)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalProject(EXPR$0=[$0], i=[true]) LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalProject(__time=[$0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) @@ -51,20 +48,17 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $5)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidProject(__time=[$0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq index 815cee22081c..9f3c3c96865f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq @@ -28,26 +28,24 @@ LogicalProject(EXPR$0=[$1], EXPR$1=[$0]) LogicalAggregate(group=[{0}], EXPR$0=[COUNT(DISTINCT $1)]) LogicalProject(EXPR$1=[EXTRACT(FLAG(MONTH), $0)], dim1=[$1]) LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[<>($1, '')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{2}]) + LogicalFilter(condition=[=($1, 'def')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(EXPR$0=[$1], EXPR$1=[$0], druid=[logical]) DruidAggregate(group=[{0}], EXPR$0=[COUNT(DISTINCT $1)], druid=[logical]) DruidProject(EXPR$1=[EXTRACT(FLAG(MONTH), $0)], dim1=[$1], druid=[logical]) DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[<>($1, '')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{2}], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq index 3509ec6a1a4c..364dfc008bd3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq @@ -24,24 +24,22 @@ SELECT dim1, EXTRACT(MONTH FROM __time) FROM druid.foo !ok LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[<>($1, '')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) + LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{2}]) + LogicalFilter(condition=[=($1, 'def')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[=($0, 'def')]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[<>($1, '')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{2}], druid=[logical]) + DruidFilter(condition=[=($1, 'def')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[=($0, 'def')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq index 2a1fe567c7bc..5f625d69ff6b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq index 50e4c3675ec1..37075b061e40 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq index c8ffd0383265..1bcdb99c9891 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq @@ -24,33 +24,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq index 4d7eb46237cc..8940cba96ae4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq index 427ddddec469..ca34a0e084bb 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq index 177e9f80e215..b2bd8ec99739 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq index 0793a84dd071..60a6d1fcc88d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq @@ -27,33 +27,29 @@ GROUP BY 1; LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) LogicalJoin(condition=[=($0, $3)], joinType=[inner]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalProject(__time=[$0], dim1=[$1]) + LogicalProject(__time=[$0], dim1=[$1]) + LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($1, 1)]) - LogicalProject(__time=[$0], cnt=[$4]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($1, 2)]) - LogicalProject(__time=[$0], cnt=[$4]) + LogicalFilter(condition=[=($4, 1)]) LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) + LogicalFilter(condition=[<>($4, 2)]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) DruidJoin(condition=[=($0, $3)], joinType=[inner]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidProject(__time=[$0], dim1=[$1], druid=[logical]) + DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($1, 1)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($1, 2)]) - DruidProject(__time=[$0], cnt=[$4], druid=[logical]) + DruidFilter(condition=[=($4, 1)]) DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) + DruidFilter(condition=[<>($4, 2)]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq index ac60be0f1877..6f1fb9a7f431 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq index 1f9dc026e281..3b36bd704946 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq index 2862670cadba..e9c664d48d03 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq @@ -23,25 +23,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq index 82a4547547a9..cb7942249a9a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq index d6af4f932825..711e704cc4d9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq index cb834c89adfb..af0fb0a20d7a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq index 3a0ccd84b1b5..9e92c8c5278e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq @@ -26,25 +26,23 @@ group by dim1, dim2 ORDER BY dim2; LogicalSort(sort0=[$1], dir0=[ASC]) LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalFilter(condition=[<>($0, 'xxx')]) - LogicalProject(dim1=[$1], dim2=[$2]) + LogicalProject(dim1=[$1], dim2=[$2]) + LogicalFilter(condition=[<>($1, 'xxx')]) + LogicalTableScan(table=[[druid, foo]]) + LogicalAggregate(group=[{1}]) + LogicalFilter(condition=[<>($1, '')]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidFilter(condition=[<>($0, 'xxx')]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) + DruidFilter(condition=[<>($1, 'xxx')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidAggregate(group=[{1}], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq index 65b0c6d0b4a5..dcff8e213aee 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_disabled@NullHandling=default.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq index 4cb67b4369a3..e45394da7f8f 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@all_enabled@NullHandling=default.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq index a1d9690fb3f5..ad6509bd826e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@default@NullHandling=default.iq @@ -23,10 +23,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -34,10 +33,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq index 4f19e43af855..346a65b95040 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-on-value-column_disabled@NullHandling=default.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq index ed51ff790238..9b72fc597c0a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites-disabled@NullHandling=default.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq index 3b71cf83b0c6..c2c40dc99523 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@filter-rewrites@NullHandling=default.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq index 99221dc5ea3d..b08872faf7d7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryWithExtractionFns@join-to-filter@NullHandling=default.iq @@ -26,10 +26,9 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT()]) LogicalProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{0}]) - LogicalProject(EXPR$0=[SUBSTRING($0, 1, 1)]) - LogicalFilter(condition=[<>($0, '')]) - LogicalProject(dim1=[$1]) - LogicalTableScan(table=[[druid, foo]]) + LogicalProject(EXPR$0=[SUBSTRING($1, 1, 1)]) + LogicalFilter(condition=[<>($1, '')]) + LogicalTableScan(table=[[druid, foo]]) !logicalPlan DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) @@ -37,10 +36,9 @@ DruidAggregate(group=[{0}], EXPR$1=[COUNT()], druid=[logical]) DruidProject(dim2=[$2], $f1=[SUBSTRING($2, 1, 1)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(EXPR$0=[SUBSTRING($0, 1, 1)], druid=[logical]) - DruidFilter(condition=[<>($0, '')]) - DruidProject(dim1=[$1], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidProject(EXPR$0=[SUBSTRING($1, 1, 1)], druid=[logical]) + DruidFilter(condition=[<>($1, '')]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) !druidPlan { From 8f286b376e7893552e7949277a695fcbe6281a9b Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Sat, 7 Dec 2024 16:51:07 +0000 Subject: [PATCH 78/99] a --- ...riceWithFiltersOnDimAndAllUnnestColumns.iq | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq new file mode 100644 index 000000000000..23b89e6e323a --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq @@ -0,0 +1,123 @@ +# testUnnestThriceWithFiltersOnDimAndAllUnnestColumns case-crc:d1566ac4 +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// + SELECT dimZipf, dim3_unnest1, dim3_unnest2, dim3_unnest3 FROM + ( SELECT * FROM + ( SELECT * FROM lotsocolumns, UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest1) ) ,UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest2) + ), UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest3) WHERE dimZipf=27 AND dim3_unnest1='Baz' AND dim3_unnest2='Hello' AND dim3_unnest3='World'; ++---------+--------------+--------------+--------------+ +| dimZipf | dim3_unnest1 | dim3_unnest2 | dim3_unnest3 | ++---------+--------------+--------------+--------------+ ++---------+--------------+--------------+--------------+ +(0 rows) + +!ok +LogicalProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unnest2=[$1], dim3_unnest3=[$3]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($2)], filter=[=($0, 'World')]) + LogicalProject(dimZipf=[$1], EXPR$0=[$2], dimMultivalEnumerated0=[$0]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'Hello')]) + LogicalProject(dimMultivalEnumerated=[$0], dimZipf=[$1]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'Baz')]) + LogicalProject(dimMultivalEnumerated=[$2], dimZipf=[$8]) + LogicalFilter(condition=[=(CAST($8):INTEGER, 27)]) + LogicalTableScan(table=[[druid, lotsocolumns]]) + +!logicalPlan +DruidProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unnest2=[$1], dim3_unnest3=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($2)], filter=[=($0, 'World')]) + DruidProject(dimZipf=[$1], EXPR$0=[$2], dimMultivalEnumerated0=[$0], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'Hello')]) + DruidProject(dimMultivalEnumerated=[$0], dimZipf=[$1], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'Baz')]) + DruidProject(dimMultivalEnumerated=[$2], dimZipf=[$8], druid=[logical]) + DruidFilter(condition=[=(CAST($8):INTEGER, 27)]) + DruidTableScan(table=[[druid, lotsocolumns]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "unnest", + "base" : { + "type" : "unnest", + "base" : { + "type" : "filter", + "base" : { + "type" : "table", + "name" : "lotsocolumns" + }, + "filter" : { + "type" : "equals", + "column" : "dimZipf", + "matchValueType" : "LONG", + "matchValue" : 27 + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "mv_to_array(\"dimMultivalEnumerated\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "Baz" + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "mv_to_array(\"dimMultivalEnumerated\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "Hello" + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "_j0.unnest", + "expression" : "mv_to_array(\"dimMultivalEnumerated\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "equals", + "column" : "_j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "World" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "virtualColumns" : [ { + "type" : "expression", + "name" : "v0", + "expression" : "'Baz'", + "outputType" : "STRING" + } ], + "resultFormat" : "compactedList", + "columns" : [ "dimZipf", "v0", "j0.unnest", "_j0.unnest" ], + "columnTypes" : [ "STRING", "STRING", "STRING", "STRING" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan From 4e842197248ecf6b509f9df6f9b7eae547dbce34 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Sat, 7 Dec 2024 16:56:24 +0000 Subject: [PATCH 79/99] removals --- ...riceWithFiltersOnDimAndAllUnnestColumns.iq | 193 ++++++++++++++++-- ...olumnsArrayColumns@NullHandling=default.iq | 51 ++--- .../testUnnestWithGroupByHavingSelector.iq | 7 +- ...hInputRefCondition@NullHandling=default.iq | 103 ---------- ...nWithInputRefCondition@NullHandling=sql.iq | 161 --------------- ...smatchWithLiterals@NullHandling=default.iq | 110 ---------- ...peMismatchWithLiterals@NullHandling=sql.iq | 111 ---------- ...meFilterOnSubquery@NullHandling=default.iq | 92 --------- ...stTimeFilterOnSubquery@NullHandling=sql.iq | 88 -------- 9 files changed, 201 insertions(+), 715 deletions(-) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq index 23b89e6e323a..f486f1e99794 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq @@ -13,11 +13,162 @@ ( SELECT * FROM ( SELECT * FROM lotsocolumns, UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest1) ) ,UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest2) ), UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest3) WHERE dimZipf=27 AND dim3_unnest1='Baz' AND dim3_unnest2='Hello' AND dim3_unnest3='World'; -+---------+--------------+--------------+--------------+ -| dimZipf | dim3_unnest1 | dim3_unnest2 | dim3_unnest3 | -+---------+--------------+--------------+--------------+ -+---------+--------------+--------------+--------------+ -(0 rows) +org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : Error while executing SQL " SELECT dimZipf, dim3_unnest1, dim3_unnest2, dim3_unnest3 FROM + ( SELECT * FROM + ( SELECT * FROM lotsocolumns, UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest1) ) ,UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest2) + ), UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest3) WHERE dimZipf=27 AND dim3_unnest1='Baz' AND dim3_unnest2='Hello' AND dim3_unnest3='World'": Remote driver error: UOE: Predicate does not support ARRAY types + at org.apache.calcite.avatica.Helper.createException(Helper.java:54) + at org.apache.calcite.avatica.Helper.createException(Helper.java:41) + at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:164) + at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:228) + at net.hydromatic.quidem.Quidem.checkResult(Quidem.java:299) + at net.hydromatic.quidem.Quidem.access$2600(Quidem.java:57) + at net.hydromatic.quidem.Quidem$ContextImpl.checkResult(Quidem.java:1636) + at net.hydromatic.quidem.Quidem$CheckResultCommand.execute(Quidem.java:941) + at net.hydromatic.quidem.Quidem$CompositeCommand.execute(Quidem.java:1437) + at net.hydromatic.quidem.Quidem.execute(Quidem.java:190) + at org.apache.druid.quidem.DruidQuidemTestBase$DruidQuidemRunner.run(DruidQuidemTestBase.java:158) + at org.apache.druid.quidem.DruidQuidemTestBase$DruidQuidemRunner.run(DruidQuidemTestBase.java:138) + at org.apache.druid.sql.calcite.QTestCase$1.run(QTestCase.java:73) + at org.apache.druid.sql.calcite.QueryTestRunner.run(QueryTestRunner.java:768) + at org.apache.druid.sql.calcite.QueryTestBuilder.run(QueryTestBuilder.java:304) + at org.apache.druid.sql.calcite.BaseCalciteQueryTest.testQuery(BaseCalciteQueryTest.java:780) + at org.apache.druid.sql.calcite.CalciteArraysQueryTest.testUnnestThriceWithFiltersOnDimAndAllUnnestColumns(CalciteArraysQueryTest.java:4747) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:728) + at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) + at org.apache.druid.sql.calcite.NotYetSupported$NotYetSupportedProcessor.interceptTestMethod(NotYetSupported.java:131) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) + at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156) + at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147) + at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) + at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92) + at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86) + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:218) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:214) + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:139) + at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) + at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) + at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) + at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) + at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) + at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) + at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) + at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) + at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) + at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) + at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) +org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types + at org.apache.druid.query.filter.DruidPredicateFactory.makeArrayPredicate(DruidPredicateFactory.java:42) + at org.apache.druid.segment.filter.PredicateValueMatcherFactory.makeArrayProcessor(PredicateValueMatcherFactory.java:110) + at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:90) + at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:39) + at org.apache.druid.segment.ColumnProcessors.makeProcessorInternal(ColumnProcessors.java:290) + at org.apache.druid.segment.ColumnProcessors.makeProcessor(ColumnProcessors.java:77) + at org.apache.druid.segment.filter.SelectorFilter.makeMatcher(SelectorFilter.java:115) + at org.apache.druid.segment.join.PostJoinCursor.(PostJoinCursor.java:56) + at org.apache.druid.segment.join.PostJoinCursor.wrap(PostJoinCursor.java:67) + at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:130) + at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:105) + at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:105) + at org.apache.druid.query.scan.ScanQueryEngine$1.make(ScanQueryEngine.java:143) + at org.apache.druid.java.util.common.guava.BaseSequence.toYielder(BaseSequence.java:66) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.query.spec.SpecificSegmentQueryRunner$1.toYielder(SpecificSegmentQueryRunner.java:113) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.query.spec.SpecificSegmentQueryRunner.doNamed(SpecificSegmentQueryRunner.java:185) + at org.apache.druid.query.spec.SpecificSegmentQueryRunner$2.wrap(SpecificSegmentQueryRunner.java:165) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.java.util.common.guava.ConcatSequence.makeYielder(ConcatSequence.java:85) + at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:65) + at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) + at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) + at org.apache.druid.java.util.common.guava.LazySequence.toYielder(LazySequence.java:46) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.java.util.common.guava.MergeSequence.lambda$toYielder$0(MergeSequence.java:66) + at org.apache.druid.java.util.common.guava.BaseSequence.accumulate(BaseSequence.java:44) + at org.apache.druid.java.util.common.guava.MergeSequence.toYielder(MergeSequence.java:63) + at org.apache.druid.query.RetryQueryRunner$1.toYielder(RetryQueryRunner.java:133) + at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.query.CPUTimeMetricQueryRunner$1.wrap(CPUTimeMetricQueryRunner.java:77) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) + at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) + at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) + at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) + at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:51) + at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) + at org.apache.druid.java.util.common.guava.Yielders.each(Yielders.java:32) + at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$execute$0(DruidJdbcResultSet.java:239) + at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) + at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) + at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) + at java.base/java.lang.Thread.run(Thread.java:829) !ok LogicalProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unnest2=[$1], dim3_unnest3=[$3]) @@ -57,10 +208,13 @@ DruidProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unne "name" : "lotsocolumns" }, "filter" : { - "type" : "equals", - "column" : "dimZipf", - "matchValueType" : "LONG", - "matchValue" : 27 + "type" : "bound", + "dimension" : "dimZipf", + "lower" : "27", + "upper" : "27", + "ordering" : { + "type" : "numeric" + } } }, "virtualColumn" : { @@ -70,10 +224,9 @@ DruidProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unne "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "equals", - "column" : "j0.unnest", - "matchValueType" : "STRING", - "matchValue" : "Baz" + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "Baz" } }, "virtualColumn" : { @@ -83,10 +236,9 @@ DruidProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unne "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "equals", - "column" : "j0.unnest", - "matchValueType" : "STRING", - "matchValue" : "Hello" + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "Hello" } }, "virtualColumn" : { @@ -96,10 +248,9 @@ DruidProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unne "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "equals", - "column" : "_j0.unnest", - "matchValueType" : "STRING", - "matchValue" : "World" + "type" : "selector", + "dimension" : "_j0.unnest", + "value" : "World" } }, "intervals" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq index 4761aa247fd6..41ab9a29c26b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq @@ -92,27 +92,28 @@ org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : Error while e at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:95) - at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:91) - at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:60) - at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98) - at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452) - at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141) + at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) + at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) + at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) + at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) + at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) + at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) + at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) + at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) + at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.query.filter.DruidPredicateFactory.makeArrayPredicate(DruidPredicateFactory.java:42) at org.apache.druid.segment.filter.PredicateValueMatcherFactory.makeArrayProcessor(PredicateValueMatcherFactory.java:110) at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:90) - at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:1) + at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:39) at org.apache.druid.segment.ColumnProcessors.makeProcessorInternal(ColumnProcessors.java:290) at org.apache.druid.segment.ColumnProcessors.makeProcessor(ColumnProcessors.java:77) at org.apache.druid.segment.filter.SelectorFilter.makeMatcher(SelectorFilter.java:115) @@ -124,16 +125,16 @@ org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.query.scan.ScanQueryEngine$1.make(ScanQueryEngine.java:143) at org.apache.druid.java.util.common.guava.BaseSequence.toYielder(BaseSequence.java:66) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.query.spec.SpecificSegmentQueryRunner$1.toYielder(SpecificSegmentQueryRunner.java:113) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.query.spec.SpecificSegmentQueryRunner.doNamed(SpecificSegmentQueryRunner.java:185) at org.apache.druid.query.spec.SpecificSegmentQueryRunner$2.wrap(SpecificSegmentQueryRunner.java:165) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) @@ -143,27 +144,27 @@ org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.LazySequence.toYielder(LazySequence.java:46) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.MergeSequence.lambda$1(MergeSequence.java:66) + at org.apache.druid.java.util.common.guava.MergeSequence.lambda$toYielder$0(MergeSequence.java:66) at org.apache.druid.java.util.common.guava.BaseSequence.accumulate(BaseSequence.java:44) at org.apache.druid.java.util.common.guava.MergeSequence.toYielder(MergeSequence.java:63) at org.apache.druid.query.RetryQueryRunner$1.toYielder(RetryQueryRunner.java:133) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.query.CPUTimeMetricQueryRunner$1.wrap(CPUTimeMetricQueryRunner.java:77) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:1) + at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:51) at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) at org.apache.druid.java.util.common.guava.Yielders.each(Yielders.java:32) - at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$0(DruidJdbcResultSet.java:239) + at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$execute$0(DruidJdbcResultSet.java:239) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq index 26485b8d1e42..d0846d3cad30 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq @@ -45,10 +45,9 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "equals", - "column" : "j0.unnest", - "matchValueType" : "STRING", - "matchValue" : "b" + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "b" } }, "intervals" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq deleted file mode 100644 index 127cf341725d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=default.iq +++ /dev/null @@ -1,103 +0,0 @@ -# testJoinWithInputRefCondition@NullHandling=default case-crc:9a6c217b -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT COUNT(*) FILTER (WHERE FLOOR(100) NOT IN (SELECT m1 FROM foo)) FROM foo; -+--------+ -| EXPR$0 | -+--------+ -| 6 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0]) - LogicalProject($f0=[IS NULL($9)]) - LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $8)], joinType=[left]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], i=[LITERAL_AGG(true)]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) - DruidProject($f0=[IS NULL($9)], druid=[logical]) - DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $8)], joinType=[left]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], i=[LITERAL_AGG(true)], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "timeseries", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "m1", - "outputName" : "d0", - "outputType" : "FLOAT" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "a0", - "expression" : "1", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(CAST(floor(100), 'DOUBLE') == \"j0.d0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "a0" - }, - "filter" : { - "type" : "selector", - "dimension" : "j0.a0", - "value" : null - }, - "name" : "a0" - } ] -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq deleted file mode 100644 index 4ba876fd1c15..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition@NullHandling=sql.iq +++ /dev/null @@ -1,161 +0,0 @@ -# testJoinWithInputRefCondition@NullHandling=sql case-crc:9a6c217b -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT COUNT(*) FILTER (WHERE FLOOR(100) NOT IN (SELECT m1 FROM foo)) FROM foo; -+--------+ -| EXPR$0 | -+--------+ -| 6 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0]) - LogicalProject($f0=[OR(=($8, 0), AND(IS NULL($11), >=($9, $8)))]) - LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $10)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($5)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{5}], i=[LITERAL_AGG(true)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) - DruidProject($f0=[OR(=($8, 0), AND(IS NULL($11), >=($9, $8)))], druid=[logical]) - DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $10)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($5)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{5}], i=[LITERAL_AGG(true)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "timeseries", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "table", - "name" : "foo" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "count", - "name" : "a0" - }, { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "a1" - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "null", - "column" : "m1" - } - }, - "name" : "a1" - } ] - } - }, - "rightPrefix" : "j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "m1", - "outputName" : "d0", - "outputType" : "FLOAT" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "a0", - "expression" : "1", - "outputType" : "LONG" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(CAST(floor(100), 'DOUBLE') == \"_j0.d0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "a0" - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "equals", - "column" : "j0.a0", - "matchValueType" : "LONG", - "matchValue" : 0 - }, { - "type" : "and", - "fields" : [ { - "type" : "null", - "column" : "_j0.a0" - }, { - "type" : "expression", - "expression" : "(\"j0.a1\" >= \"j0.a0\")" - } ] - } ] - }, - "name" : "a0" - } ] -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq deleted file mode 100644 index e84db59af531..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=default.iq +++ /dev/null @@ -1,110 +0,0 @@ -# testSubqueryTypeMismatchWithLiterals@NullHandling=default case-crc:e7079756 -# quidem testcase reason: AGGREGATE_REMOVE_NOT_FIRED -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT - dim1, - SUM(CASE WHEN sum_l1 = 0 THEN 1 ELSE 0 END) AS outer_l1 -from ( - select - dim1, - SUM(l1) as sum_l1 - from numfoo - group by dim1 -) -group by 1; -+------+----------+ -| dim1 | outer_l1 | -+------+----------+ -| | 0 | -| 1 | 1 | -| 10.1 | 0 | -| 2 | 1 | -| abc | 1 | -| def | 1 | -+------+----------+ -(6 rows) - -!ok -LogicalAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1]) - LogicalProject(dim1=[$0], $f2=[=($1, 0)]) - LogicalAggregate(group=[{1}], sum_l1=[SUM($11)]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1], druid=[logical]) - DruidProject(dim1=[$0], $f2=[=($1, 0)], druid=[logical]) - DruidAggregate(group=[{1}], sum_l1=[SUM($11)], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "longSum", - "name" : "a0", - "fieldName" : "l1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "_d0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "_a0" - }, - "filter" : { - "type" : "selector", - "dimension" : "a0", - "value" : "0" - }, - "name" : "_a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq deleted file mode 100644 index b464b19c371a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals@NullHandling=sql.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testSubqueryTypeMismatchWithLiterals@NullHandling=sql case-crc:e7079756 -# quidem testcase reason: AGGREGATE_REMOVE_NOT_FIRED -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT - dim1, - SUM(CASE WHEN sum_l1 = 0 THEN 1 ELSE 0 END) AS outer_l1 -from ( - select - dim1, - SUM(l1) as sum_l1 - from numfoo - group by dim1 -) -group by 1; -+------+----------+ -| dim1 | outer_l1 | -+------+----------+ -| | 0 | -| 1 | 0 | -| 10.1 | 0 | -| 2 | 1 | -| abc | 0 | -| def | 0 | -+------+----------+ -(6 rows) - -!ok -LogicalAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1]) - LogicalProject(dim1=[$0], $f2=[IS TRUE(=($1, 0))]) - LogicalAggregate(group=[{1}], sum_l1=[SUM($11)]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1], druid=[logical]) - DruidProject(dim1=[$0], $f2=[IS TRUE(=($1, 0))], druid=[logical]) - DruidAggregate(group=[{1}], sum_l1=[SUM($11)], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "longSum", - "name" : "a0", - "fieldName" : "l1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "_d0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "_a0" - }, - "filter" : { - "type" : "equals", - "column" : "a0", - "matchValueType" : "LONG", - "matchValue" : 0 - }, - "name" : "_a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq deleted file mode 100644 index 6a74658a830b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=default.iq +++ /dev/null @@ -1,92 +0,0 @@ -# testTimeFilterOnSubquery@NullHandling=default case-crc:73448efc -# quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, m1 FROM (SELECT * FROM "foo" LIMIT 100) -WHERE TIME_IN_INTERVAL(__time, '2000/P1D') OR TIME_IN_INTERVAL(__time, '2001/P1D'); -+-------------------------+-----+ -| __time | m1 | -+-------------------------+-----+ -| 2000-01-01 00:00:00.000 | 1.0 | -| 2001-01-01 00:00:00.000 | 4.0 | -+-------------------------+-----+ -(2 rows) - -!ok -LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - LogicalSort(fetch=[100]) - LogicalProject(__time=[$0], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - DruidSort(fetch=[100], druid=[logical]) - DruidProject(__time=[$0], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "m1" ], - "columnTypes" : [ "LONG", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "bound", - "dimension" : "__time", - "lower" : "946684800000", - "upper" : "946771200000", - "upperStrict" : true, - "ordering" : { - "type" : "numeric" - } - }, { - "type" : "bound", - "dimension" : "__time", - "lower" : "978307200000", - "upper" : "978393600000", - "upperStrict" : true, - "ordering" : { - "type" : "numeric" - } - } ] - }, - "columns" : [ "__time", "m1" ], - "columnTypes" : [ "LONG", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq deleted file mode 100644 index 08aa7cdd3eb8..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery@NullHandling=sql.iq +++ /dev/null @@ -1,88 +0,0 @@ -# testTimeFilterOnSubquery@NullHandling=sql case-crc:73448efc -# quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT __time, m1 FROM (SELECT * FROM "foo" LIMIT 100) -WHERE TIME_IN_INTERVAL(__time, '2000/P1D') OR TIME_IN_INTERVAL(__time, '2001/P1D'); -+-------------------------+-----+ -| __time | m1 | -+-------------------------+-----+ -| 2000-01-01 00:00:00.000 | 1.0 | -| 2001-01-01 00:00:00.000 | 4.0 | -+-------------------------+-----+ -(2 rows) - -!ok -LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - LogicalSort(fetch=[100]) - LogicalProject(__time=[$0], m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) - DruidSort(fetch=[100], druid=[logical]) - DruidProject(__time=[$0], m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "limit" : 100, - "columns" : [ "__time", "m1" ], - "columnTypes" : [ "LONG", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "range", - "column" : "__time", - "matchValueType" : "LONG", - "lower" : 946684800000, - "upper" : 946771200000, - "upperOpen" : true - }, { - "type" : "range", - "column" : "__time", - "matchValueType" : "LONG", - "lower" : 978307200000, - "upper" : 978393600000, - "upperOpen" : true - } ] - }, - "columns" : [ "__time", "m1" ], - "columnTypes" : [ "LONG", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan From 5c5ca2716cf60e2b95ffe35beb0abae54a6253f3 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Sat, 7 Dec 2024 19:14:32 +0000 Subject: [PATCH 80/99] cleanup --- .../sql/calcite/CalciteArraysQueryTest.java | 4 +- ...riceWithFiltersOnDimAndAllUnnestColumns.iq | 193 ++---------- ...rsOnDimAndAllUnnestColumnsArrayColumns.iq} | 2 +- ...olumnsArrayColumns@NullHandling=default.iq | 274 ------------------ 4 files changed, 24 insertions(+), 449 deletions(-) rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=sql.iq => testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index f062822a9ff4..0d793293a710 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4686,7 +4686,7 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestCol() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, ignoreDefaultsMode = IgnoreDefaultsReson.UNNEST_ARRAY_ISSUE) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumns() { @@ -4755,7 +4755,7 @@ public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumns() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, ignoreDefaultsMode = IgnoreDefaultsReson.UNNEST_ARRAY_ISSUE) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns() { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq index f486f1e99794..23b89e6e323a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumns.iq @@ -13,162 +13,11 @@ ( SELECT * FROM ( SELECT * FROM lotsocolumns, UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest1) ) ,UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest2) ), UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest3) WHERE dimZipf=27 AND dim3_unnest1='Baz' AND dim3_unnest2='Hello' AND dim3_unnest3='World'; -org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : Error while executing SQL " SELECT dimZipf, dim3_unnest1, dim3_unnest2, dim3_unnest3 FROM - ( SELECT * FROM - ( SELECT * FROM lotsocolumns, UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest1) ) ,UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest2) - ), UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest3) WHERE dimZipf=27 AND dim3_unnest1='Baz' AND dim3_unnest2='Hello' AND dim3_unnest3='World'": Remote driver error: UOE: Predicate does not support ARRAY types - at org.apache.calcite.avatica.Helper.createException(Helper.java:54) - at org.apache.calcite.avatica.Helper.createException(Helper.java:41) - at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:164) - at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:228) - at net.hydromatic.quidem.Quidem.checkResult(Quidem.java:299) - at net.hydromatic.quidem.Quidem.access$2600(Quidem.java:57) - at net.hydromatic.quidem.Quidem$ContextImpl.checkResult(Quidem.java:1636) - at net.hydromatic.quidem.Quidem$CheckResultCommand.execute(Quidem.java:941) - at net.hydromatic.quidem.Quidem$CompositeCommand.execute(Quidem.java:1437) - at net.hydromatic.quidem.Quidem.execute(Quidem.java:190) - at org.apache.druid.quidem.DruidQuidemTestBase$DruidQuidemRunner.run(DruidQuidemTestBase.java:158) - at org.apache.druid.quidem.DruidQuidemTestBase$DruidQuidemRunner.run(DruidQuidemTestBase.java:138) - at org.apache.druid.sql.calcite.QTestCase$1.run(QTestCase.java:73) - at org.apache.druid.sql.calcite.QueryTestRunner.run(QueryTestRunner.java:768) - at org.apache.druid.sql.calcite.QueryTestBuilder.run(QueryTestBuilder.java:304) - at org.apache.druid.sql.calcite.BaseCalciteQueryTest.testQuery(BaseCalciteQueryTest.java:780) - at org.apache.druid.sql.calcite.CalciteArraysQueryTest.testUnnestThriceWithFiltersOnDimAndAllUnnestColumns(CalciteArraysQueryTest.java:4747) - at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) - at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.base/java.lang.reflect.Method.invoke(Method.java:566) - at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:728) - at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) - at org.apache.druid.sql.calcite.NotYetSupported$NotYetSupportedProcessor.interceptTestMethod(NotYetSupported.java:131) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) - at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156) - at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147) - at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86) - at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:218) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:214) - at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:139) - at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) - at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) - at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) - at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) - at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) - at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) - at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) - at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) - at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) - at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) - at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) - at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) - at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types - at org.apache.druid.query.filter.DruidPredicateFactory.makeArrayPredicate(DruidPredicateFactory.java:42) - at org.apache.druid.segment.filter.PredicateValueMatcherFactory.makeArrayProcessor(PredicateValueMatcherFactory.java:110) - at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:90) - at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:39) - at org.apache.druid.segment.ColumnProcessors.makeProcessorInternal(ColumnProcessors.java:290) - at org.apache.druid.segment.ColumnProcessors.makeProcessor(ColumnProcessors.java:77) - at org.apache.druid.segment.filter.SelectorFilter.makeMatcher(SelectorFilter.java:115) - at org.apache.druid.segment.join.PostJoinCursor.(PostJoinCursor.java:56) - at org.apache.druid.segment.join.PostJoinCursor.wrap(PostJoinCursor.java:67) - at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:130) - at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:105) - at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:105) - at org.apache.druid.query.scan.ScanQueryEngine$1.make(ScanQueryEngine.java:143) - at org.apache.druid.java.util.common.guava.BaseSequence.toYielder(BaseSequence.java:66) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.query.spec.SpecificSegmentQueryRunner$1.toYielder(SpecificSegmentQueryRunner.java:113) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.query.spec.SpecificSegmentQueryRunner.doNamed(SpecificSegmentQueryRunner.java:185) - at org.apache.druid.query.spec.SpecificSegmentQueryRunner$2.wrap(SpecificSegmentQueryRunner.java:165) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.ConcatSequence.makeYielder(ConcatSequence.java:85) - at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:65) - at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) - at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) - at org.apache.druid.java.util.common.guava.LazySequence.toYielder(LazySequence.java:46) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.MergeSequence.lambda$toYielder$0(MergeSequence.java:66) - at org.apache.druid.java.util.common.guava.BaseSequence.accumulate(BaseSequence.java:44) - at org.apache.druid.java.util.common.guava.MergeSequence.toYielder(MergeSequence.java:63) - at org.apache.druid.query.RetryQueryRunner$1.toYielder(RetryQueryRunner.java:133) - at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.query.CPUTimeMetricQueryRunner$1.wrap(CPUTimeMetricQueryRunner.java:77) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) - at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:51) - at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) - at org.apache.druid.java.util.common.guava.Yielders.each(Yielders.java:32) - at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$execute$0(DruidJdbcResultSet.java:239) - at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) - at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) - at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) - at java.base/java.lang.Thread.run(Thread.java:829) ++---------+--------------+--------------+--------------+ +| dimZipf | dim3_unnest1 | dim3_unnest2 | dim3_unnest3 | ++---------+--------------+--------------+--------------+ ++---------+--------------+--------------+--------------+ +(0 rows) !ok LogicalProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unnest2=[$1], dim3_unnest3=[$3]) @@ -208,13 +57,10 @@ DruidProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unne "name" : "lotsocolumns" }, "filter" : { - "type" : "bound", - "dimension" : "dimZipf", - "lower" : "27", - "upper" : "27", - "ordering" : { - "type" : "numeric" - } + "type" : "equals", + "column" : "dimZipf", + "matchValueType" : "LONG", + "matchValue" : 27 } }, "virtualColumn" : { @@ -224,9 +70,10 @@ DruidProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unne "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "Baz" + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "Baz" } }, "virtualColumn" : { @@ -236,9 +83,10 @@ DruidProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unne "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "Hello" + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "Hello" } }, "virtualColumn" : { @@ -248,9 +96,10 @@ DruidProject(dimZipf=[$0], dim3_unnest1=[CAST('Baz':VARCHAR):VARCHAR], dim3_unne "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "selector", - "dimension" : "_j0.unnest", - "value" : "World" + "type" : "equals", + "column" : "_j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "World" } }, "intervals" : { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns.iq index f3f49221becb..df2fe0dd3f45 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns.iq @@ -1,4 +1,4 @@ -# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=sql case-crc:84cffaf8 +# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns case-crc:84cffaf8 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq deleted file mode 100644 index 41ab9a29c26b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default.iq +++ /dev/null @@ -1,274 +0,0 @@ -# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns@NullHandling=default case-crc:84cffaf8 -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// - SELECT arrayString, uln, udn, usn FROM - ( SELECT * FROM - ( SELECT * FROM arrays, UNNEST(arrayLongNulls) as ut(uln)) ,UNNEST(arrayDoubleNulls) as ut(udn) - ), UNNEST(arrayStringNulls) as ut(usn) WHERE arrayString = ARRAY['a','b'] AND uln = 1 AND udn = 2.2 AND usn = 'a'; -org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : Error while executing SQL " SELECT arrayString, uln, udn, usn FROM - ( SELECT * FROM - ( SELECT * FROM arrays, UNNEST(arrayLongNulls) as ut(uln)) ,UNNEST(arrayDoubleNulls) as ut(udn) - ), UNNEST(arrayStringNulls) as ut(usn) WHERE arrayString = ARRAY['a','b'] AND uln = 1 AND udn = 2.2 AND usn = 'a'": Remote driver error: UOE: Predicate does not support ARRAY types - at org.apache.calcite.avatica.Helper.createException(Helper.java:54) - at org.apache.calcite.avatica.Helper.createException(Helper.java:41) - at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:164) - at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:228) - at net.hydromatic.quidem.Quidem.checkResult(Quidem.java:299) - at net.hydromatic.quidem.Quidem.access$2600(Quidem.java:57) - at net.hydromatic.quidem.Quidem$ContextImpl.checkResult(Quidem.java:1636) - at net.hydromatic.quidem.Quidem$CheckResultCommand.execute(Quidem.java:941) - at net.hydromatic.quidem.Quidem$CompositeCommand.execute(Quidem.java:1437) - at net.hydromatic.quidem.Quidem.execute(Quidem.java:190) - at org.apache.druid.quidem.DruidQuidemTestBase$DruidQuidemRunner.run(DruidQuidemTestBase.java:158) - at org.apache.druid.quidem.DruidQuidemTestBase$DruidQuidemRunner.run(DruidQuidemTestBase.java:138) - at org.apache.druid.sql.calcite.QTestCase$1.run(QTestCase.java:73) - at org.apache.druid.sql.calcite.QueryTestRunner.run(QueryTestRunner.java:768) - at org.apache.druid.sql.calcite.QueryTestBuilder.run(QueryTestBuilder.java:304) - at org.apache.druid.sql.calcite.BaseCalciteQueryTest.testQuery(BaseCalciteQueryTest.java:780) - at org.apache.druid.sql.calcite.CalciteArraysQueryTest.testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns(CalciteArraysQueryTest.java:4816) - at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) - at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.base/java.lang.reflect.Method.invoke(Method.java:566) - at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:728) - at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) - at org.apache.druid.sql.calcite.NotYetSupported$NotYetSupportedProcessor.interceptTestMethod(NotYetSupported.java:131) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) - at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156) - at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147) - at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) - at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92) - at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86) - at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:218) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:214) - at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:139) - at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) - at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) - at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) - at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) - at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) - at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) - at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) - at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) - at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) - at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) - at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) - at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) - at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141) - at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) - at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) - at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) - at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) - at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) - at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) - at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) - at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) - at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) -org.apache.druid.java.util.common.UOE: Predicate does not support ARRAY types - at org.apache.druid.query.filter.DruidPredicateFactory.makeArrayPredicate(DruidPredicateFactory.java:42) - at org.apache.druid.segment.filter.PredicateValueMatcherFactory.makeArrayProcessor(PredicateValueMatcherFactory.java:110) - at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:90) - at org.apache.druid.segment.filter.StringConstantValueMatcherFactory.makeArrayProcessor(StringConstantValueMatcherFactory.java:39) - at org.apache.druid.segment.ColumnProcessors.makeProcessorInternal(ColumnProcessors.java:290) - at org.apache.druid.segment.ColumnProcessors.makeProcessor(ColumnProcessors.java:77) - at org.apache.druid.segment.filter.SelectorFilter.makeMatcher(SelectorFilter.java:115) - at org.apache.druid.segment.join.PostJoinCursor.(PostJoinCursor.java:56) - at org.apache.druid.segment.join.PostJoinCursor.wrap(PostJoinCursor.java:67) - at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:130) - at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:105) - at org.apache.druid.segment.UnnestCursorFactory$1.asCursor(UnnestCursorFactory.java:105) - at org.apache.druid.query.scan.ScanQueryEngine$1.make(ScanQueryEngine.java:143) - at org.apache.druid.java.util.common.guava.BaseSequence.toYielder(BaseSequence.java:66) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.query.spec.SpecificSegmentQueryRunner$1.toYielder(SpecificSegmentQueryRunner.java:113) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.query.spec.SpecificSegmentQueryRunner.doNamed(SpecificSegmentQueryRunner.java:185) - at org.apache.druid.query.spec.SpecificSegmentQueryRunner$2.wrap(SpecificSegmentQueryRunner.java:165) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.ConcatSequence.makeYielder(ConcatSequence.java:85) - at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:65) - at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) - at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) - at org.apache.druid.java.util.common.guava.LazySequence.toYielder(LazySequence.java:46) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.MergeSequence.lambda$toYielder$0(MergeSequence.java:66) - at org.apache.druid.java.util.common.guava.BaseSequence.accumulate(BaseSequence.java:44) - at org.apache.druid.java.util.common.guava.MergeSequence.toYielder(MergeSequence.java:63) - at org.apache.druid.query.RetryQueryRunner$1.toYielder(RetryQueryRunner.java:133) - at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.query.CPUTimeMetricQueryRunner$1.wrap(CPUTimeMetricQueryRunner.java:77) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:88) - at org.apache.druid.java.util.common.guava.WrappingSequence$2.get(WrappingSequence.java:84) - at org.apache.druid.java.util.common.guava.SequenceWrapper.wrap(SequenceWrapper.java:55) - at org.apache.druid.java.util.common.guava.WrappingSequence.toYielder(WrappingSequence.java:83) - at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) - at org.apache.druid.java.util.common.guava.ConcatSequence.toYielder(ConcatSequence.java:51) - at org.apache.druid.java.util.common.guava.MappedSequence.toYielder(MappedSequence.java:49) - at org.apache.druid.java.util.common.guava.Yielders.each(Yielders.java:32) - at org.apache.druid.sql.avatica.DruidJdbcResultSet.lambda$execute$0(DruidJdbcResultSet.java:239) - at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) - at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) - at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) - at java.base/java.lang.Thread.run(Thread.java:829) - -!ok -LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[1:BIGINT], udn=[$1], usn=[$2]) - LogicalUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) - LogicalProject(arrayStringNulls=[$0], udn=[$2]) - LogicalUnnest(unnestExpr=[$1], filter=[=($0, 2.2)]) - LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2]) - LogicalUnnest(unnestExpr=[$1], filter=[=($0, 1)]) - LogicalProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) - LogicalFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - LogicalTableScan(table=[[druid, arrays]]) - -!logicalPlan -DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[1:BIGINT], udn=[$1], usn=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) - DruidProject(arrayStringNulls=[$0], udn=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[$1], filter=[=($0, 2.2)]) - DruidProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], druid=[logical]) - DruidUnnest(unnestExpr=[$1], filter=[=($0, 1)]) - DruidProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) - DruidFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - DruidTableScan(table=[[druid, arrays]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "unnest", - "base" : { - "type" : "unnest", - "base" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "arrays" - }, - "filter" : { - "type" : "expression", - "expression" : "(\"arrayString\" == array('a','b'))" - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "\"arrayLongNulls\"", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "1" - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "\"arrayDoubleNulls\"", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "2.2" - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "_j0.unnest", - "expression" : "\"arrayStringNulls\"", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "selector", - "dimension" : "_j0.unnest", - "value" : "a" - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "array('a','b')", - "outputType" : "ARRAY" - }, { - "type" : "expression", - "name" : "v1", - "expression" : "1", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "v0", "v1", "j0.unnest", "_j0.unnest" ], - "columnTypes" : [ "ARRAY", "LONG", "DOUBLE", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan From 86bec3bdc01b8a15554cf9ef22466d9f1bd75cd1 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 11 Dec 2024 13:17:00 +0000 Subject: [PATCH 81/99] update --- .../org/apache/druid/msq/exec/MSQSelectTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java index 09dcbfcda144..75a7c7e16374 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java @@ -2492,12 +2492,11 @@ public void testJoinUsesDifferentAlgorithm(String contextName, Map Date: Thu, 12 Dec 2024 14:12:20 +0000 Subject: [PATCH 82/99] fix for sqlcompat --- .../testUnnestWithGroupByHavingSelector.iq | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq index d0846d3cad30..26485b8d1e42 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq @@ -45,9 +45,10 @@ DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) "outputType" : "ARRAY" }, "unnestFilter" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "b" + "type" : "equals", + "column" : "j0.unnest", + "matchValueType" : "STRING", + "matchValue" : "b" } }, "intervals" : { From ef12701816524672c479e0b9cf32e91731100a51 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 12 Dec 2024 14:13:43 +0000 Subject: [PATCH 83/99] up --- .../sql/calcite/CalciteArraysQueryTest.java | 2 +- ...upByHavingSelector@NullHandling=default.iq | 74 +++++++++++++++++++ ...GroupByHavingSelector@NullHandling=sql.iq} | 2 +- 3 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithGroupByHavingSelector.iq => testUnnestWithGroupByHavingSelector@NullHandling=sql.iq} (96%) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 0d793293a710..3e60757395fd 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -6417,7 +6417,7 @@ public void testUnnestWithCountOnColumn() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) @Test public void testUnnestWithGroupByHavingSelector() { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=default.iq new file mode 100644 index 000000000000..74df6d4e1359 --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=default.iq @@ -0,0 +1,74 @@ +# testUnnestWithGroupByHavingSelector@NullHandling=default case-crc:76a4f833 +# quidem testcase reason: IMPROVED_PLAN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// +SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) GROUP BY d3 HAVING d3='b'; ++----+--------+ +| d3 | EXPR$1 | ++----+--------+ +| b | 2 | ++----+--------+ +(1 row) + +!ok +LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'b')]) + LogicalProject(dim3=[$3]) + LogicalTableScan(table=[[druid, numfoo]]) + +!logicalPlan +DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'b')]) + DruidProject(dim3=[$3], druid=[logical]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + +!druidPlan +{ + "queryType" : "groupBy", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "table", + "name" : "numfoo" + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "mv_to_array(\"dim3\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : { + "type" : "selector", + "dimension" : "j0.unnest", + "value" : "b" + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "granularity" : { + "type" : "all" + }, + "dimensions" : [ { + "type" : "default", + "dimension" : "j0.unnest", + "outputName" : "d0", + "outputType" : "STRING" + } ], + "aggregations" : [ { + "type" : "count", + "name" : "a0" + } ], + "limitSpec" : { + "type" : "NoopLimitSpec" + } +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=sql.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=sql.iq index 26485b8d1e42..93c713a6c94e 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=sql.iq @@ -1,4 +1,4 @@ -# testUnnestWithGroupByHavingSelector case-crc:76a4f833 +# testUnnestWithGroupByHavingSelector@NullHandling=sql case-crc:76a4f833 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 From 19609943aa24ef0c3df37884c2301c354ee76192 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 13 Dec 2024 10:06:24 +0000 Subject: [PATCH 84/99] trial of accepting empty project --- .../calcite/planner/CalciteRulesManager.java | 4 +- .../rule/logical/LogicalUnnestRule.java | 47 +++++++++++++++---- ...ayColumnsOrFilters@NullHandling=default.iq | 18 ++++--- ...reOnUnnestArrayCol@NullHandling=default.iq | 14 +++--- 4 files changed, 53 insertions(+), 30 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index cc7caeade632..4cdc35f0edc6 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -296,7 +296,7 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC cleanupRules.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(true), + new DruidTrimFieldsProgram(false), Programs.of(cleanupRules.build(), true, DefaultRelMetadataProvider.INSTANCE) ); } @@ -553,7 +553,7 @@ public RelNode run( { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); final RelNode decorrelatedRel = RelDecorrelator.decorrelateQuery(rel, relBuilder); - RelNode ret = new DruidRelFieldTrimmer(null, relBuilder, true).trim(decorrelatedRel); + RelNode ret = new DruidRelFieldTrimmer(null, relBuilder, false).trim(decorrelatedRel); return ret; } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnestRule.java b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnestRule.java index 8771070b4fd8..287cde5e38a4 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnestRule.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/rule/logical/LogicalUnnestRule.java @@ -19,6 +19,7 @@ package org.apache.druid.sql.calcite.rule.logical; +import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import org.apache.calcite.plan.RelOptRule; import org.apache.calcite.plan.RelOptRuleCall; @@ -82,14 +83,16 @@ public void onMatch(RelOptRuleCall call) throw DruidException.defensive("Couldn't process possible unnest for reltree: \n%s", RelOptUtil.toString(cor)); } - unnestConfig.expr = new DruidCorrelateUnnestRel.CorrelatedFieldAccessToInputRef(cor.getCorrelationId()) - .apply(unnestConfig.expr); + unnestConfig = unnestConfig.withExpr( + new DruidCorrelateUnnestRel.CorrelatedFieldAccessToInputRef(cor.getCorrelationId()) + .apply(unnestConfig.expr) + ); RelDataTypeField unnestFieldType = Iterables.getLast(cor.getRowType().getFieldList()); RelBuilder builder = call.builder(); builder.push(cor.getLeft()); - RelNode newNode = builder.push( + builder.push( new LogicalUnnest( cor.getCluster(), cor.getTraitSet(), @@ -98,35 +101,59 @@ public void onMatch(RelOptRuleCall call) unnestFieldType, unnestConfig.condition ) - ).build(); - call.transformTo(newNode); + ); + if (unnestConfig.discard) { + // drop unnested output column + ImmutableList fields = builder.fields(); + builder.project(fields.subList(0, fields.size() - 1)); + } + call.transformTo(builder.build()); } private static class UnnestConfiguration { - public RexNode expr; - private RexNode condition; + protected final RexNode expr; + protected final RexNode condition; + protected final boolean discard; + - public UnnestConfiguration(RexNode unnestExpression, RexNode condition) + public UnnestConfiguration(RexNode unnestExpression, RexNode condition, boolean discard) { this.expr = unnestExpression; this.condition = condition; + this.discard = discard; + } + + public UnnestConfiguration withExpr(RexNode expr) + { + return new UnnestConfiguration(expr, condition, discard); } public static UnnestConfiguration ofExpression(RexNode unnestExpression) { - return new UnnestConfiguration(unnestExpression, null); + return new UnnestConfiguration(unnestExpression, null, false); } public UnnestConfiguration withFilter(RexNode condition) { - return new UnnestConfiguration(expr, condition); + return new UnnestConfiguration(expr, condition, discard); + } + + public UnnestConfiguration withDiscard() + { + return new UnnestConfiguration(expr, condition, true); } } private UnnestConfiguration unwrapUnnestConfigurationExpression(RelNode rel) { rel = rel.stripped(); + if (rel instanceof Project) { + Project project = (Project) rel; + if (project.getProjects().size() == 0) { + return unwrapUnnestConfigurationExpression(project.getInput()).withDiscard(); + } + } if (rel instanceof Filter) { Filter filter = (Filter) rel; UnnestConfiguration conf = unwrapUnnestConfigurationExpression(filter.getInput()); diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq index f604252db9a4..5a8542970a9d 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq @@ -30,11 +30,10 @@ LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY] LogicalProject(arrayStringNulls=[$0], uln=[$2], udn=[$3]) LogicalFilter(condition=[OR(=($2, 1), =($3, 2.2))]) LogicalUnnest(unnestExpr=[$1]) - LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3]) - LogicalUnnest(unnestExpr=[$1]) - LogicalProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) - LogicalFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - LogicalTableScan(table=[[druid, arrays]]) + LogicalProject(arrayStringNulls=[$2], arrayDoubleNulls=[$6], uln=[$12]) + LogicalUnnest(unnestExpr=[$4]) + LogicalFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + LogicalTableScan(table=[[druid, arrays]]) !logicalPlan DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3], druid=[logical]) @@ -42,11 +41,10 @@ DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], DruidProject(arrayStringNulls=[$0], uln=[$2], udn=[$3], druid=[logical]) DruidFilter(condition=[OR(=($2, 1), =($3, 2.2))]) DruidUnnest(unnestExpr=[$1]) - DruidProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3], druid=[logical]) - DruidUnnest(unnestExpr=[$1]) - DruidProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) - DruidFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - DruidTableScan(table=[[druid, arrays]], druid=[logical]) + DruidProject(arrayStringNulls=[$2], arrayDoubleNulls=[$6], uln=[$12], druid=[logical]) + DruidUnnest(unnestExpr=[$4]) + DruidFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq index e46f6bef54b0..5ca239e88312 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq @@ -18,16 +18,14 @@ SELECT uln, COUNT(*) FROM druid.arrays, UNNEST(arrayLongNulls) AS unnested(uln) (1 row) !ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalUnnest(unnestExpr=[$0], filter=[=($0, 1)]) - LogicalProject(arrayLongNulls=[$4]) - LogicalTableScan(table=[[druid, arrays]]) +LogicalAggregate(group=[{12}], EXPR$1=[COUNT()]) + LogicalUnnest(unnestExpr=[$4], filter=[=($0, 1)]) + LogicalTableScan(table=[[druid, arrays]]) !logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidUnnest(unnestExpr=[$0], filter=[=($0, 1)]) - DruidProject(arrayLongNulls=[$4], druid=[logical]) - DruidTableScan(table=[[druid, arrays]], druid=[logical]) +DruidAggregate(group=[{12}], EXPR$1=[COUNT()], druid=[logical]) + DruidUnnest(unnestExpr=[$4], filter=[=($0, 1)]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) !druidPlan { From c51607e1b1d2d62ab5db90bde2ec4857e6fb95e5 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 13 Dec 2024 10:09:37 +0000 Subject: [PATCH 85/99] fix --- .../calcite/planner/DruidRelFieldTrimmer.java | 2 +- ...rayColumnsOrFilters@NullHandling=default.iq | 18 ++++++++++-------- ...ereOnUnnestArrayCol@NullHandling=default.iq | 14 ++++++++------ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 5982aefb3a33..6577ea3857e3 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -101,7 +101,7 @@ public TrimResult trimFields( ImmutableBitSet fieldsUsed, Set extraFields) { - if (trimTableScan) { + if (fieldsUsed.cardinality()>0 || trimTableScan) { return super.trimFields(tableAccessRel, fieldsUsed, extraFields); } else { Mapping mapping = Mappings.createIdentity(tableAccessRel.getRowType().getFieldCount()); diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq index 5a8542970a9d..f604252db9a4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq @@ -30,10 +30,11 @@ LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY] LogicalProject(arrayStringNulls=[$0], uln=[$2], udn=[$3]) LogicalFilter(condition=[OR(=($2, 1), =($3, 2.2))]) LogicalUnnest(unnestExpr=[$1]) - LogicalProject(arrayStringNulls=[$2], arrayDoubleNulls=[$6], uln=[$12]) - LogicalUnnest(unnestExpr=[$4]) - LogicalFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - LogicalTableScan(table=[[druid, arrays]]) + LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3]) + LogicalUnnest(unnestExpr=[$1]) + LogicalProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) + LogicalFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + LogicalTableScan(table=[[druid, arrays]]) !logicalPlan DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3], druid=[logical]) @@ -41,10 +42,11 @@ DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], DruidProject(arrayStringNulls=[$0], uln=[$2], udn=[$3], druid=[logical]) DruidFilter(condition=[OR(=($2, 1), =($3, 2.2))]) DruidUnnest(unnestExpr=[$1]) - DruidProject(arrayStringNulls=[$2], arrayDoubleNulls=[$6], uln=[$12], druid=[logical]) - DruidUnnest(unnestExpr=[$4]) - DruidFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - DruidTableScan(table=[[druid, arrays]], druid=[logical]) + DruidProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3], druid=[logical]) + DruidUnnest(unnestExpr=[$1]) + DruidProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) + DruidFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) !druidPlan { diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq index 5ca239e88312..e46f6bef54b0 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq @@ -18,14 +18,16 @@ SELECT uln, COUNT(*) FROM druid.arrays, UNNEST(arrayLongNulls) AS unnested(uln) (1 row) !ok -LogicalAggregate(group=[{12}], EXPR$1=[COUNT()]) - LogicalUnnest(unnestExpr=[$4], filter=[=($0, 1)]) - LogicalTableScan(table=[[druid, arrays]]) +LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) + LogicalUnnest(unnestExpr=[$0], filter=[=($0, 1)]) + LogicalProject(arrayLongNulls=[$4]) + LogicalTableScan(table=[[druid, arrays]]) !logicalPlan -DruidAggregate(group=[{12}], EXPR$1=[COUNT()], druid=[logical]) - DruidUnnest(unnestExpr=[$4], filter=[=($0, 1)]) - DruidTableScan(table=[[druid, arrays]], druid=[logical]) +DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) + DruidUnnest(unnestExpr=[$0], filter=[=($0, 1)]) + DruidProject(arrayLongNulls=[$4], druid=[logical]) + DruidTableScan(table=[[druid, arrays]], druid=[logical]) !druidPlan { From a161b6c6d4f4203216a956c073a914b92bb7f84c Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 13 Dec 2024 10:47:03 +0000 Subject: [PATCH 86/99] retain for old --- .../apache/druid/sql/calcite/planner/CalciteRulesManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index 4cdc35f0edc6..ccaa8b378e60 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -553,7 +553,7 @@ public RelNode run( { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); final RelNode decorrelatedRel = RelDecorrelator.decorrelateQuery(rel, relBuilder); - RelNode ret = new DruidRelFieldTrimmer(null, relBuilder, false).trim(decorrelatedRel); + RelNode ret = new DruidRelFieldTrimmer(null, relBuilder, true).trim(decorrelatedRel); return ret; } From dde6e0659651a297cc4e1a5ff534191967bfdd35 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 13 Dec 2024 10:49:06 +0000 Subject: [PATCH 87/99] remove boolean --- .../calcite/planner/CalciteRulesManager.java | 13 +++--------- .../calcite/planner/DruidRelFieldTrimmer.java | 20 ++----------------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java index ccaa8b378e60..97b7168f4ae3 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java @@ -296,7 +296,7 @@ private Program buildDecoupledLogicalOptimizationProgram(PlannerContext plannerC cleanupRules.addRuleInstance(AggregateProjectMergeRule.Config.DEFAULT.toRule()); return Programs.sequence( Programs.of(builder.build(), true, DefaultRelMetadataProvider.INSTANCE), - new DruidTrimFieldsProgram(false), + new DruidTrimFieldsProgram(), Programs.of(cleanupRules.build(), true, DefaultRelMetadataProvider.INSTANCE) ); } @@ -553,7 +553,7 @@ public RelNode run( { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); final RelNode decorrelatedRel = RelDecorrelator.decorrelateQuery(rel, relBuilder); - RelNode ret = new DruidRelFieldTrimmer(null, relBuilder, true).trim(decorrelatedRel); + RelNode ret = new DruidRelFieldTrimmer(null, relBuilder).trim(decorrelatedRel); return ret; } @@ -562,13 +562,6 @@ public RelNode run( /** Program that trims fields. */ private static class DruidTrimFieldsProgram implements Program { - private boolean trim; - - public DruidTrimFieldsProgram(boolean trim) - { - this.trim = trim; - } - @Override public RelNode run(RelOptPlanner planner, RelNode rel, RelTraitSet requiredOutputTraits, @@ -576,7 +569,7 @@ public RelNode run(RelOptPlanner planner, RelNode rel, List lattices) { final RelBuilder relBuilder = RelFactories.LOGICAL_BUILDER.create(rel.getCluster(), null); - RelNode ret = new DruidRelFieldTrimmer(null, relBuilder, trim).trim(rel); + RelNode ret = new DruidRelFieldTrimmer(null, relBuilder).trim(rel); return ret; } } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 6577ea3857e3..f379d14e99f9 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -24,7 +24,6 @@ import org.apache.calcite.rel.RelHomogeneousShuttle; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.CorrelationId; -import org.apache.calcite.rel.core.TableScan; import org.apache.calcite.rel.logical.LogicalCorrelate; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataTypeField; @@ -53,14 +52,12 @@ public class DruidRelFieldTrimmer extends RelFieldTrimmer { - private final boolean trimTableScan; private final RelBuilder relBuilder; - public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuilder, boolean trimTableScan) + public DruidRelFieldTrimmer(@Nullable SqlValidator validator, RelBuilder relBuilder) { super(validator, relBuilder); this.relBuilder = relBuilder; - this.trimTableScan = trimTableScan; } @Override @@ -72,7 +69,7 @@ protected TrimResult dummyProject(int fieldCount, RelNode input) protected TrimResult dummyProject(int fieldCount, RelNode input, @Nullable RelNode originalRelNode) { - if (fieldCount != 0 && trimTableScan) { + if (fieldCount != 0) { return super.dummyProject(fieldCount, input, originalRelNode); } // workaround to support fieldCount == 0 projections @@ -96,19 +93,6 @@ private TrimResult makeIdentityMapping(RelNode input) return result(input, mapping); } - public TrimResult trimFields( - final TableScan tableAccessRel, - ImmutableBitSet fieldsUsed, - Set extraFields) - { - if (fieldsUsed.cardinality()>0 || trimTableScan) { - return super.trimFields(tableAccessRel, fieldsUsed, extraFields); - } else { - Mapping mapping = Mappings.createIdentity(tableAccessRel.getRowType().getFieldCount()); - return result(tableAccessRel, mapping, tableAccessRel); - } - } - public TrimResult trimFields(LogicalCorrelate correlate, ImmutableBitSet fieldsUsed, Set extraFields) From c8d23927f83ca18d56336bcdbab893c4802d96fe Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 13 Dec 2024 14:26:00 +0000 Subject: [PATCH 88/99] add missing override --- .../apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index f379d14e99f9..0adb93698d71 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -66,6 +66,7 @@ protected TrimResult dummyProject(int fieldCount, RelNode input) return makeIdentityMapping(input); } + @Override protected TrimResult dummyProject(int fieldCount, RelNode input, @Nullable RelNode originalRelNode) { From 3477592133a02935656fb7c09c5263a06e10ee2c Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 13 Dec 2024 16:15:15 +0000 Subject: [PATCH 89/99] up --- .../java/org/apache/druid/sql/calcite/CalciteQueryTest.java | 2 ++ .../org/apache/druid/sql/calcite/DecoupledTestConfig.java | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 1ce317ccc690..21b4d77131d1 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -121,6 +121,7 @@ import org.apache.druid.segment.column.RowSignature; import org.apache.druid.segment.join.JoinType; import org.apache.druid.segment.virtual.ExpressionVirtualColumn; +import org.apache.druid.sql.calcite.DecoupledTestConfig.IgnoreQueriesReason; import org.apache.druid.sql.calcite.DecoupledTestConfig.QuidemTestCaseReason; import org.apache.druid.sql.calcite.NotYetSupported.Modes; import org.apache.druid.sql.calcite.expression.DruidExpression; @@ -5185,6 +5186,7 @@ public void testGroupByWithSortOnPostAggregationNoTopNContext() ); } + @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.EQUIV_PLAN) @Test public void testFilteredAggregations() { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java index 353071441af9..7594913e6082 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java @@ -80,7 +80,11 @@ enum IgnoreQueriesReason /** * Occurs in tandem with {@link NotYetSupported.Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS}. */ - RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS; + RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS, + /** + * Not really different plan. + */ + EQUIV_PLAN; public boolean isPresent() { From 7e5658e6b7abfaa5fd04b9f9370ef9935f6cb0dd Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 19 Dec 2024 07:18:28 +0000 Subject: [PATCH 90/99] add apidoc --- .../sql/calcite/planner/DruidRelFieldTrimmer.java | 5 +++++ .../apache/druid/sql/calcite/CalciteQueryTest.java | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 0adb93698d71..9a3673c62567 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -50,6 +50,11 @@ import java.util.List; import java.util.Set; +/** + * DruidRelFieldTrimmer is a subclass of RelFieldTrimmer that provides additional support for Druid specific RelNodes. + * + * It is used to trim fields from Druid specific RelNodes like LogicalUnnest. + */ public class DruidRelFieldTrimmer extends RelFieldTrimmer { private final RelBuilder relBuilder; diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index e280535f04a8..55e6da387629 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -26,6 +26,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import org.apache.calcite.rel.RelNode; +import org.apache.calcite.rel.logical.LogicalCorrelate; import org.apache.calcite.runtime.CalciteContextException; import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; @@ -41,7 +42,6 @@ import org.apache.druid.math.expr.ExprMacroTable; import org.apache.druid.query.Druids; import org.apache.druid.query.InlineDataSource; -import org.apache.druid.query.JoinAlgorithm; import org.apache.druid.query.JoinDataSource; import org.apache.druid.query.LookupDataSource; import org.apache.druid.query.OperatorFactoryBuilders; @@ -15894,6 +15894,17 @@ public void testDistinctNotSupportedWithWindow() assertThat(e, invalidSqlContains("DISTINCT is not supported for window functions")); } + @Test + public void testRelFieldTrimmerUpgrade() + { + assertEquals( + "1.37.0", + RelNode.class.getPackage().getImplementationVersion(), + "Calcite version changed; check if DruidRelFieldTrimmer#trimFields(LogicalCorrelate correlate,...) is still needed or not!" + ); + } + + @Test public void testUnSupportedAggInSelectWindow() { From d1e8ae160c7d9af70e2db21cda358433c8ec1961 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 19 Dec 2024 07:22:25 +0000 Subject: [PATCH 91/99] up --- .../java/org/apache/druid/sql/calcite/CalciteQueryTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 55e6da387629..5d78a8349cd8 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -26,7 +26,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.logical.LogicalCorrelate; import org.apache.calcite.runtime.CalciteContextException; import org.apache.druid.common.config.NullHandling; import org.apache.druid.error.DruidException; @@ -42,6 +41,7 @@ import org.apache.druid.math.expr.ExprMacroTable; import org.apache.druid.query.Druids; import org.apache.druid.query.InlineDataSource; +import org.apache.druid.query.JoinAlgorithm; import org.apache.druid.query.JoinDataSource; import org.apache.druid.query.LookupDataSource; import org.apache.druid.query.OperatorFactoryBuilders; From c518b488b627ec3812d2e511b99700eb3d13f2d2 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 19 Dec 2024 07:27:37 +0000 Subject: [PATCH 92/99] fix compile; add doc --- .../org/apache/druid/query/FrameBasedInlineDataSource.java | 2 +- .../test/java/org/apache/druid/server/QuerySchedulerTest.java | 2 +- .../apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/processing/src/main/java/org/apache/druid/query/FrameBasedInlineDataSource.java b/processing/src/main/java/org/apache/druid/query/FrameBasedInlineDataSource.java index c821d061a5e9..68d3db9a36d3 100644 --- a/processing/src/main/java/org/apache/druid/query/FrameBasedInlineDataSource.java +++ b/processing/src/main/java/org/apache/druid/query/FrameBasedInlineDataSource.java @@ -103,7 +103,7 @@ public Sequence getRowsAsSequence() .collect(Collectors.toList()); return Sequences.simple( - () -> new Iterator<>() + () -> new Iterator() { @Override public boolean hasNext() diff --git a/server/src/test/java/org/apache/druid/server/QuerySchedulerTest.java b/server/src/test/java/org/apache/druid/server/QuerySchedulerTest.java index 3ed5d5938bf6..ed602678a82c 100644 --- a/server/src/test/java/org/apache/druid/server/QuerySchedulerTest.java +++ b/server/src/test/java/org/apache/druid/server/QuerySchedulerTest.java @@ -666,7 +666,7 @@ private Sequence makeSequence(int count) { return new LazySequence<>(() -> { return new BaseSequence<>( - new BaseSequence.IteratorMaker<>() + new BaseSequence.IteratorMaker>() { @Override public Iterator make() diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 9a3673c62567..2d6a05687af4 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -99,6 +99,9 @@ private TrimResult makeIdentityMapping(RelNode input) return result(input, mapping); } + /** + * Should be unnecesarry in versions having CALCITE-6715 + */ public TrimResult trimFields(LogicalCorrelate correlate, ImmutableBitSet fieldsUsed, Set extraFields) From db8d4225d1aeb756b39b297544c06bde978229ca Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 19 Dec 2024 07:30:38 +0000 Subject: [PATCH 93/99] rename test --- .../java/org/apache/druid/sql/calcite/CalciteQueryTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 5d78a8349cd8..46f045da2a90 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -15895,7 +15895,7 @@ public void testDistinctNotSupportedWithWindow() } @Test - public void testRelFieldTrimmerUpgrade() + public void testLogicalCorrelateTrimFieldsStillNeeded() { assertEquals( "1.37.0", From 8d46ff5c704d2a33e2d70eec47289c4244733010 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Thu, 19 Dec 2024 07:34:12 +0000 Subject: [PATCH 94/99] update apidoc --- .../druid/sql/calcite/planner/DruidRelFieldTrimmer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java index 2d6a05687af4..e772a9b44ea2 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidRelFieldTrimmer.java @@ -51,9 +51,9 @@ import java.util.Set; /** - * DruidRelFieldTrimmer is a subclass of RelFieldTrimmer that provides additional support for Druid specific RelNodes. + * DruidRelFieldTrimmer is a subclass of {@link RelFieldTrimmer} that provides additional support for Druid specific RelNodes. * - * It is used to trim fields from Druid specific RelNodes like LogicalUnnest. + * It is used to trim fields from Druid specific RelNodes like {@link LogicalUnnest}. */ public class DruidRelFieldTrimmer extends RelFieldTrimmer { From a700f52093c642826b84b2140e62673f2702ca45 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 7 Jan 2025 14:27:25 +0000 Subject: [PATCH 95/99] Add test for join with input ref condition Add a test to ensure that CalciteJoinQuery can handle join queries with input ref conditions. --- .../java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java index 946fed52c746..1d3b4852b282 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java @@ -6134,7 +6134,7 @@ public void testJoinsWithThreeConditions() ) ); } -// + @Test public void testJoinWithInputRefCondition() { From 8f189e4cda7a78fc20bc317ea9c1dc99b07cfebe Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 7 Jan 2025 16:17:04 +0000 Subject: [PATCH 96/99] Update test configuration and annotation for unnest predicate not supported - Modified the @NotYetSupported annotation to @NotYetSupported(Modes.UNNEST_PREDICATE_NOT_SUPPORTED) in CalciteArraysQueryTest.java. - Updated the @DecoupledTestConfig annotation to @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.PREDICATE_NOT_SUPPORTED) in CalciteArraysQueryTest.java. - These changes reflect the need to support unnest predicates in the future. --- .../org/apache/druid/sql/calcite/CalciteArraysQueryTest.java | 4 ++-- .../org/apache/druid/sql/calcite/DecoupledTestConfig.java | 4 ++-- .../java/org/apache/druid/sql/calcite/NotYetSupported.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 3e60757395fd..d71804ffbf6f 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4598,8 +4598,8 @@ public void testUnnestTwiceWithFiltersAndExpressions() ); } - @NotYetSupported(Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS) + @NotYetSupported(Modes.UNNEST_PREDICATE_NOT_SUPPORTED) + @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.PREDICATE_NOT_SUPPORTED) @Test public void testUnnestThriceWithFiltersOnDimAndUnnestCol() { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java index 7594913e6082..9d49a0726aff 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledTestConfig.java @@ -78,9 +78,9 @@ enum IgnoreQueriesReason */ UNNEST_EXTRA_SCANQUERY, /** - * Occurs in tandem with {@link NotYetSupported.Modes.RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS}. + * Occurs in tandem with {@link NotYetSupported.Modes#PREDICATE_NOT_SUPPORTED}. */ - RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS, + PREDICATE_NOT_SUPPORTED, /** * Not really different plan. */ diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java b/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java index fbd5e8410c10..0b7063867d5c 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java @@ -93,7 +93,7 @@ enum Modes REQUIRE_TIME_CONDITION(CannotBuildQueryException.class, "requireTimeCondition is enabled"), UNNEST_INLINED(Exception.class, "Missing conversion is Uncollect"), UNNEST_RESULT_MISMATCH(AssertionError.class, "(Result count mismatch|column content mismatch)"), - RESULT_MISMATCH_NATIVE_UNNEST_INCORRECT_RESULTS(Throwable.class, "(Result count mismatch|column content mismatch|ARRAY)"); + UNNEST_PREDICATE_NOT_SUPPORTED(Throwable.class, "Predicate does not support ARRAY types"); // @formatter:on public Class throwableClass; From 96be3a250b3f94ef14038513ab090d253d99fcd9 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 10 Jan 2025 12:08:39 +0000 Subject: [PATCH 97/99] fx --- .../apache/druid/msq/exec/MSQSelectTest.java | 5 ----- .../sql/calcite/CalciteArraysQueryTest.java | 17 +++++------------ .../druid/sql/calcite/CalciteJoinQueryTest.java | 1 - .../druid/sql/calcite/DecoupledExtension.java | 10 ---------- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java index f241bffabdd5..39df97297162 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java @@ -2438,11 +2438,6 @@ public void testSelectRowsGetUntruncatedByDefault(String contextName, Map context) { RowSignature resultSignature = RowSignature.builder() diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 4cf9ebbb75cf..13731b78bb6e 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4742,7 +4742,7 @@ public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumns() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) @Test public void testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations() { @@ -4804,7 +4804,7 @@ public void testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) @Test public void testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters() { @@ -5168,9 +5168,6 @@ public void testUnnestVirtualWithColumns2() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) - @DecoupledTestConfig(ignoreDefaultsMode = IgnoreDefaultsReson.UNNEST_EMPTY_DIFFERENCE) - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN) @Test public void testUnnestWithFilters() { @@ -5274,7 +5271,6 @@ public void testUnnestWithInFiltersWithExpressionInInnerQuery() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNUSED_VIRTUALCOLUMN, separateDefaultModeTest = true) @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNUSED_VIRTUALCOLUMN) @Test public void testUnnestWithFiltersInnerLimit() @@ -5317,9 +5313,6 @@ public void testUnnestWithFiltersInnerLimit() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN, separateDefaultModeTest = true) - @DecoupledTestConfig(ignoreDefaultsMode = IgnoreDefaultsReson.UNNEST_EMPTY_DIFFERENCE) - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.UNNEST_EXTRA_SCAN) @Test public void testUnnestWithFiltersInsideAndOutside() { @@ -6224,7 +6217,7 @@ public void testUnnestWithCountOnColumn() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) @Test public void testUnnestWithGroupByHavingSelector() { @@ -6360,7 +6353,7 @@ public void testUnnestWithGroupByHavingWithWhereOnAggCol() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) @Test public void testUnnestWithGroupByHavingWithWhereOnUnnestCol() { @@ -6420,7 +6413,7 @@ public void testUnnestWithGroupByWithWhereOnUnnestArrayCol() ); } - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN, separateDefaultModeTest = true) + @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.IMPROVED_PLAN) @Test public void testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol() { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java index 10acc7743113..2784f929df5a 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java @@ -5890,7 +5890,6 @@ public void testJoinsWithThreeConditions() } @Test - @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS, separateDefaultModeTest = true) @DecoupledTestConfig(quidemReason = QuidemTestCaseReason.JOIN_FILTER_LOCATIONS) public void testJoinWithInputRefCondition() { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java index 2c1e9e0488f2..341d5599e630 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/DecoupledExtension.java @@ -27,7 +27,6 @@ import org.apache.druid.quidem.ProjectPathUtils; import org.apache.druid.server.security.AuthConfig; import org.apache.druid.sql.calcite.BaseCalciteQueryTest.CalciteTestConfig; -import org.apache.druid.sql.calcite.DecoupledTestConfig.IgnoreDefaultsReson; import org.apache.druid.sql.calcite.planner.PlannerConfig; import org.apache.druid.sql.calcite.util.SqlTestFramework; import org.junit.jupiter.api.extension.BeforeEachCallback; @@ -36,8 +35,6 @@ import java.io.File; import java.util.List; -import static org.junit.jupiter.api.Assumptions.assumeTrue; - public class DecoupledExtension implements BeforeEachCallback { private BaseCalciteQueryTest baseTest; @@ -71,13 +68,6 @@ public QueryTestBuilder testBuilder() boolean ignoreQueries = (decTestConfig != null && decTestConfig.ignoreExpectedQueriesReason().isPresent()); - if (NullHandling.replaceWithDefault()) { - assumeTrue( - decTestConfig == null || decTestConfig.ignoreDefaultsMode() == IgnoreDefaultsReson.NONE, - "Disabled beacuse ignoreDefaultsMode specified" - ); - } - CalciteTestConfig testConfig = baseTest.new CalciteTestConfig(CONTEXT_OVERRIDES) { From 163dcb4ddfbb06ad3e9bfd589097b8a714702b8b Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 10 Jan 2025 14:20:38 +0000 Subject: [PATCH 98/99] u --- .../sql/calcite/CalciteArraysQueryTest.java | 3 +- .../druid/sql/calcite/NotYetSupported.java | 3 +- ...dAllUnnestColumnsArrayColumnsOrFilters.iq} | 2 +- ...ayColumnsOrFilters@NullHandling=default.iq | 132 --------- ...ersOnDimAndUnnestColumnsORCombinations.iq} | 2 +- ...umnsORCombinations@NullHandling=default.iq | 134 --------- .../testUnnestWithFiltersInnerLimit.iq | 93 ++++++ ...=> testUnnestWithGroupByHavingSelector.iq} | 2 +- ...upByHavingSelector@NullHandling=default.iq | 74 ----- ...GroupByHavingWithWhereOnUnnestArrayCol.iq} | 2 +- ...reOnUnnestArrayCol@NullHandling=default.iq | 74 ----- ...tWithGroupByHavingWithWhereOnUnnestCol.iq} | 2 +- ...thWhereOnUnnestCol@NullHandling=default.iq | 74 ----- .../testInnerJoinCastLeft@all_disabled.iq | 20 -- ...testInnerJoinCastLeft@all_disabled.iq.orig | 116 -------- .../testInnerJoinCastLeft@all_enabled.iq | 16 - .../testInnerJoinCastLeft@all_enabled.iq.orig | 116 -------- .../testInnerJoinCastLeft@default.iq | 20 -- .../testInnerJoinCastLeft@default.iq.orig | 113 -------- ...astLeft@filter-on-value-column_disabled.iq | 20 -- ...ft@filter-on-value-column_disabled.iq.orig | 116 -------- ...erJoinCastLeft@filter-rewrites-disabled.iq | 20 -- ...nCastLeft@filter-rewrites-disabled.iq.orig | 116 -------- .../testInnerJoinCastLeft@filter-rewrites.iq | 20 -- ...tInnerJoinCastLeft@filter-rewrites.iq.orig | 116 -------- .../testInnerJoinCastLeft@join-to-filter.iq | 20 -- ...stInnerJoinCastLeft@join-to-filter.iq.orig | 116 -------- ...ataSources_withLeftDirectAccess@default.iq | 14 - ...thLeftDirectAccess@default_BACKUP_20591.iq | 146 ---------- ...thLeftDirectAccess@default_BACKUP_21312.iq | 146 ---------- ...withLeftDirectAccess@default_BASE_20591.iq | 131 --------- ...withLeftDirectAccess@default_BASE_21312.iq | 131 --------- ...ithLeftDirectAccess@default_LOCAL_20591.iq | 131 --------- ...ithLeftDirectAccess@default_LOCAL_21312.iq | 131 --------- ...thLeftDirectAccess@default_REMOTE_20591.iq | 132 --------- ...thLeftDirectAccess@default_REMOTE_21312.iq | 132 --------- ...sults@all_disabled@NullHandling=default.iq | 273 ----------------- ...esults@all_enabled@NullHandling=default.iq | 273 ----------------- ...ptyResults@default@NullHandling=default.iq | 270 ----------------- ...ue-column_disabled@NullHandling=default.iq | 273 ----------------- ...-rewrites-disabled@NullHandling=default.iq | 273 ----------------- ...ts@filter-rewrites@NullHandling=default.iq | 273 ----------------- ...lts@join-to-filter@NullHandling=default.iq | 273 ----------------- ...sults@all_disabled@NullHandling=default.iq | 274 ------------------ ...esults@all_enabled@NullHandling=default.iq | 274 ------------------ ...ptyResults@default@NullHandling=default.iq | 271 ----------------- ...ue-column_disabled@NullHandling=default.iq | 274 ------------------ ...-rewrites-disabled@NullHandling=default.iq | 274 ------------------ ...ts@filter-rewrites@NullHandling=default.iq | 274 ------------------ ...lts@join-to-filter@NullHandling=default.iq | 274 ------------------ .../testJoinWithInputRefCondition.iq | 41 +-- ...ilter@all_disabled@NullHandling=default.iq | 159 ---------- ...Filter@all_enabled@NullHandling=default.iq | 159 ---------- ...WithFilter@default@NullHandling=default.iq | 156 ---------- ...ue-column_disabled@NullHandling=default.iq | 159 ---------- ...-rewrites-disabled@NullHandling=default.iq | 159 ---------- ...er@filter-rewrites@NullHandling=default.iq | 159 ---------- ...ter@join-to-filter@NullHandling=default.iq | 159 ---------- ...Joins@all_disabled@NullHandling=default.iq | 157 ---------- ...tJoins@all_enabled@NullHandling=default.iq | 157 ---------- ...licitJoins@default@NullHandling=default.iq | 154 ---------- ...ue-column_disabled@NullHandling=default.iq | 157 ---------- ...-rewrites-disabled@NullHandling=default.iq | 157 ---------- ...ns@filter-rewrites@NullHandling=default.iq | 157 ---------- ...ins@join-to-filter@NullHandling=default.iq | 157 ---------- ...query@all_disabled@NullHandling=default.iq | 237 --------------- ...bquery@all_enabled@NullHandling=default.iq | 237 --------------- ...InSubquery@default@NullHandling=default.iq | 234 --------------- ...ue-column_disabled@NullHandling=default.iq | 237 --------------- ...-rewrites-disabled@NullHandling=default.iq | 237 --------------- ...ry@filter-rewrites@NullHandling=default.iq | 237 --------------- ...ery@join-to-filter@NullHandling=default.iq | 237 --------------- ...gregateWithOrderBy@NullHandling=default.iq | 154 ---------- ...ously@all_disabled@NullHandling=default.iq | 165 ----------- ...eously@all_enabled@NullHandling=default.iq | 165 ----------- ...ltaneously@default@NullHandling=default.iq | 162 ----------- ...ue-column_disabled@NullHandling=default.iq | 165 ----------- ...-rewrites-disabled@NullHandling=default.iq | 165 ----------- ...ly@filter-rewrites@NullHandling=default.iq | 165 ----------- ...sly@join-to-filter@NullHandling=default.iq | 165 ----------- ...ilter@all_disabled@NullHandling=default.iq | 152 ---------- ...Filter@all_enabled@NullHandling=default.iq | 152 ---------- ...fAndFilter@default@NullHandling=default.iq | 149 ---------- ...ue-column_disabled@NullHandling=default.iq | 152 ---------- ...-rewrites-disabled@NullHandling=default.iq | 152 ---------- ...er@filter-rewrites@NullHandling=default.iq | 152 ---------- ...ter@join-to-filter@NullHandling=default.iq | 152 ---------- ...estGroupByWithLiteralInSubqueryGrouping.iq | 2 +- ...ithGroupingAndOtherAggregatorsUsingJoin.iq | 4 +- .../testSubqueryTypeMismatchWithLiterals.iq | 111 ------- .../testTimeFilterOnSubquery.iq | 88 ++++++ 91 files changed, 199 insertions(+), 12735 deletions(-) rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq => testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=sql.iq => testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations.iq} (99%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=default.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithGroupByHavingSelector@NullHandling=sql.iq => testUnnestWithGroupByHavingSelector.iq} (96%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=sql.iq => testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol.iq} (95%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq rename sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/{testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq => testUnnestWithGroupByHavingWithWhereOnUnnestCol.iq} (95%) delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq.orig delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq.orig delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq.orig delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq.orig delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq.orig delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq.orig delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq.orig delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BACKUP_20591.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BACKUP_21312.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BASE_20591.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BASE_21312.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_LOCAL_20591.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_LOCAL_21312.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_REMOTE_20591.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_REMOTE_21312.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq delete mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals.iq create mode 100644 sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery.iq diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 13731b78bb6e..07ea20f9cc17 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4523,8 +4523,7 @@ public void testUnnestTwiceWithFiltersAndExpressions() ); } - @NotYetSupported(Modes.UNNEST_PREDICATE_NOT_SUPPORTED) - @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.PREDICATE_NOT_SUPPORTED) + @NotYetSupported(Modes.UNNEST_RESULT_MISMATCH) @Test public void testUnnestThriceWithFiltersOnDimAndUnnestCol() { diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java b/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java index 0b7063867d5c..2f4199d429a3 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/NotYetSupported.java @@ -92,8 +92,7 @@ enum Modes SORT_REMOVE_CONSTANT_KEYS_CONFLICT(DruidException.class, "not enough rules"), REQUIRE_TIME_CONDITION(CannotBuildQueryException.class, "requireTimeCondition is enabled"), UNNEST_INLINED(Exception.class, "Missing conversion is Uncollect"), - UNNEST_RESULT_MISMATCH(AssertionError.class, "(Result count mismatch|column content mismatch)"), - UNNEST_PREDICATE_NOT_SUPPORTED(Throwable.class, "Predicate does not support ARRAY types"); + UNNEST_RESULT_MISMATCH(AssertionError.class, "(Result count mismatch|column content mismatch)"); // @formatter:on public Class throwableClass; diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters.iq index eea95e1c8fa0..03d6e16878f9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters.iq @@ -1,4 +1,4 @@ -# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=sql case-crc:8bc6fb6b +# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters case-crc:8bc6fb6b # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq deleted file mode 100644 index f604252db9a4..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default.iq +++ /dev/null @@ -1,132 +0,0 @@ -# testUnnestThriceWithFiltersOnDimAndAllUnnestColumnsArrayColumnsOrFilters@NullHandling=default case-crc:8bc6fb6b -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// - SELECT arrayString, uln, udn, usn FROM - ( SELECT * FROM - ( SELECT * FROM arrays, UNNEST(arrayLongNulls) as ut(uln)) ,UNNEST(arrayDoubleNulls) as ut(udn) - ), UNNEST(arrayStringNulls) as ut(usn) WHERE arrayString = ARRAY['a','b'] AND (uln = 1 OR udn = 2.2) AND usn = 'a'; -+-------------+-----+-----+-----+ -| arrayString | uln | udn | usn | -+-------------+-----+-----+-----+ -| [a, b] | 1 | 1.1 | a | -| [a, b] | 1 | 2.2 | a | -| [a, b] | 1 | | a | -| [a, b] | 3 | 2.2 | a | -| [a, b] | | 2.2 | a | -+-------------+-----+-----+-----+ -(5 rows) - -!ok -LogicalProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3]) - LogicalUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) - LogicalProject(arrayStringNulls=[$0], uln=[$2], udn=[$3]) - LogicalFilter(condition=[OR(=($2, 1), =($3, 2.2))]) - LogicalUnnest(unnestExpr=[$1]) - LogicalProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3]) - LogicalUnnest(unnestExpr=[$1]) - LogicalProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6]) - LogicalFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - LogicalTableScan(table=[[druid, arrays]]) - -!logicalPlan -DruidProject(arrayString=[CAST(ARRAY('a':VARCHAR, 'b':VARCHAR)):VARCHAR ARRAY], uln=[$1], udn=[$2], usn=[$3], druid=[logical]) - DruidUnnest(unnestExpr=[$0], filter=[=($0, 'a')]) - DruidProject(arrayStringNulls=[$0], uln=[$2], udn=[$3], druid=[logical]) - DruidFilter(condition=[OR(=($2, 1), =($3, 2.2))]) - DruidUnnest(unnestExpr=[$1]) - DruidProject(arrayStringNulls=[$0], arrayDoubleNulls=[$2], uln=[$3], druid=[logical]) - DruidUnnest(unnestExpr=[$1]) - DruidProject(arrayStringNulls=[$2], arrayLongNulls=[$4], arrayDoubleNulls=[$6], druid=[logical]) - DruidFilter(condition=[=($1, CAST(ARRAY('a', 'b')):VARCHAR ARRAY NOT NULL)]) - DruidTableScan(table=[[druid, arrays]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "filter", - "base" : { - "type" : "unnest", - "base" : { - "type" : "unnest", - "base" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "arrays" - }, - "filter" : { - "type" : "expression", - "expression" : "(\"arrayString\" == array('a','b'))" - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "\"arrayLongNulls\"", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "virtualColumn" : { - "type" : "expression", - "name" : "_j0.unnest", - "expression" : "\"arrayDoubleNulls\"", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "_j0.unnest", - "value" : "2.2" - } ] - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "__j0.unnest", - "expression" : "\"arrayStringNulls\"", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "selector", - "dimension" : "__j0.unnest", - "value" : "a" - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "array('a','b')", - "outputType" : "ARRAY" - } ], - "resultFormat" : "compactedList", - "columns" : [ "v0", "j0.unnest", "_j0.unnest", "__j0.unnest" ], - "columnTypes" : [ "ARRAY", "LONG", "DOUBLE", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations.iq similarity index 99% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations.iq index 2f67ac598954..c540f1da0cc1 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations.iq @@ -1,4 +1,4 @@ -# testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=sql case-crc:b18b7dbe +# testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations case-crc:b18b7dbe # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=default.iq deleted file mode 100644 index ee9c01b7132b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=default.iq +++ /dev/null @@ -1,134 +0,0 @@ -# testUnnestThriceWithFiltersOnDimAndUnnestColumnsORCombinations@NullHandling=default case-crc:b18b7dbe -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// - SELECT dimZipf, dim3_unnest1, dim3_unnest2, dim3_unnest3 FROM - ( SELECT * FROM - ( SELECT * FROM lotsocolumns, UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest1) ) ,UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest2) - ), UNNEST(MV_TO_ARRAY(dimMultivalEnumerated)) as ut(dim3_unnest3) WHERE dimZipf=27 AND (dim3_unnest1='Baz' OR dim3_unnest2='Hello') AND dim3_unnest3='World'; -+---------+--------------+--------------+--------------+ -| dimZipf | dim3_unnest1 | dim3_unnest2 | dim3_unnest3 | -+---------+--------------+--------------+--------------+ -| 27 | Baz | Baz | World | -| 27 | Baz | Baz | World | -| 27 | Baz | Baz | World | -| 27 | Baz | Baz | World | -| 27 | Baz | Hello | World | -| 27 | Baz | Hello | World | -| 27 | Baz | World | World | -| 27 | Baz | World | World | -| 27 | Hello | Hello | World | -| 27 | World | Hello | World | -+---------+--------------+--------------+--------------+ -(10 rows) - -!ok -LogicalProject(dimZipf=[$0], dim3_unnest1=[$1], dim3_unnest2=[$2], dim3_unnest3=[$4]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[=($0, 'World')]) - LogicalProject(dimZipf=[$1], dim3_unnest1=[$2], EXPR$0=[$3], dimMultivalEnumerated0=[$0]) - LogicalFilter(condition=[OR(=($2, 'Baz'), =($3, 'Hello'))]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) - LogicalProject(dimMultivalEnumerated=[$2], dimZipf=[$8]) - LogicalFilter(condition=[=(CAST($8):INTEGER, 27)]) - LogicalTableScan(table=[[druid, lotsocolumns]]) - -!logicalPlan -DruidProject(dimZipf=[$0], dim3_unnest1=[$1], dim3_unnest2=[$2], dim3_unnest3=[$4], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($3)], filter=[=($0, 'World')]) - DruidProject(dimZipf=[$1], dim3_unnest1=[$2], EXPR$0=[$3], dimMultivalEnumerated0=[$0], druid=[logical]) - DruidFilter(condition=[OR(=($2, 'Baz'), =($3, 'Hello'))]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) - DruidProject(dimMultivalEnumerated=[$2], dimZipf=[$8], druid=[logical]) - DruidFilter(condition=[=(CAST($8):INTEGER, 27)]) - DruidTableScan(table=[[druid, lotsocolumns]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "filter", - "base" : { - "type" : "unnest", - "base" : { - "type" : "unnest", - "base" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "lotsocolumns" - }, - "filter" : { - "type" : "bound", - "dimension" : "dimZipf", - "lower" : "27", - "upper" : "27", - "ordering" : { - "type" : "numeric" - } - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dimMultivalEnumerated\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "virtualColumn" : { - "type" : "expression", - "name" : "_j0.unnest", - "expression" : "mv_to_array(\"dimMultivalEnumerated\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : null - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "Baz" - }, { - "type" : "selector", - "dimension" : "_j0.unnest", - "value" : "Hello" - } ] - } - }, - "virtualColumn" : { - "type" : "expression", - "name" : "__j0.unnest", - "expression" : "mv_to_array(\"dimMultivalEnumerated\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "selector", - "dimension" : "__j0.unnest", - "value" : "World" - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dimZipf", "j0.unnest", "_j0.unnest", "__j0.unnest" ], - "columnTypes" : [ "STRING", "STRING", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit.iq new file mode 100644 index 000000000000..31ff3b725c6d --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithFiltersInnerLimit.iq @@ -0,0 +1,93 @@ +# testUnnestWithFiltersInnerLimit case-crc:1f5acfc8 +# quidem testcase reason: UNUSED_VIRTUALCOLUMN +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set sqlStringifyArrays false +!set outputformat mysql +!use druidtest:/// +SELECT d3 FROM (select dim2,dim3 from druid.numfoo where dim2='a' LIMIT 2), UNNEST(MV_TO_ARRAY(dim3)) as unnested (d3); ++----+ +| d3 | ++----+ +| | +| a | +| b | ++----+ +(3 rows) + +!ok +LogicalProject(d3=[$1]) + LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + LogicalProject(dim3=[$1]) + LogicalSort(fetch=[2]) + LogicalProject(dim2=[$2], dim3=[$3]) + LogicalFilter(condition=[=($2, 'a')]) + LogicalTableScan(table=[[druid, numfoo]]) + +!logicalPlan +DruidProject(d3=[$1], druid=[logical]) + DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)]) + DruidProject(dim3=[$1], druid=[logical]) + DruidSort(fetch=[2], druid=[logical]) + DruidProject(dim2=[$2], dim3=[$3], druid=[logical]) + DruidFilter(condition=[=($2, 'a')]) + DruidTableScan(table=[[druid, numfoo]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "unnest", + "base" : { + "type" : "query", + "query" : { + "queryType" : "scan", + "dataSource" : { + "type" : "table", + "name" : "numfoo" + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "resultFormat" : "compactedList", + "limit" : 2, + "filter" : { + "type" : "equals", + "column" : "dim2", + "matchValueType" : "STRING", + "matchValue" : "a" + }, + "columns" : [ "dim3" ], + "columnTypes" : [ "STRING" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false + } + }, + "virtualColumn" : { + "type" : "expression", + "name" : "j0.unnest", + "expression" : "mv_to_array(\"dim3\")", + "outputType" : "ARRAY" + }, + "unnestFilter" : null + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "resultFormat" : "compactedList", + "columns" : [ "j0.unnest" ], + "columnTypes" : [ "STRING" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq similarity index 96% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq index 93c713a6c94e..26485b8d1e42 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector.iq @@ -1,4 +1,4 @@ -# testUnnestWithGroupByHavingSelector@NullHandling=sql case-crc:76a4f833 +# testUnnestWithGroupByHavingSelector case-crc:76a4f833 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=default.iq deleted file mode 100644 index 74df6d4e1359..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingSelector@NullHandling=default.iq +++ /dev/null @@ -1,74 +0,0 @@ -# testUnnestWithGroupByHavingSelector@NullHandling=default case-crc:76a4f833 -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) GROUP BY d3 HAVING d3='b'; -+----+--------+ -| d3 | EXPR$1 | -+----+--------+ -| b | 2 | -+----+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'b')]) - LogicalProject(dim3=[$3]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'b')]) - DruidProject(dim3=[$3], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "table", - "name" : "numfoo" - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "b" - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.unnest", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol.iq similarity index 95% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol.iq index c69694e0001e..c9dafab17d0a 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol.iq @@ -1,4 +1,4 @@ -# testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=sql case-crc:33b6333c +# testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol case-crc:33b6333c # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq deleted file mode 100644 index e46f6bef54b0..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default.iq +++ /dev/null @@ -1,74 +0,0 @@ -# testUnnestWithGroupByHavingWithWhereOnUnnestArrayCol@NullHandling=default case-crc:33b6333c -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT uln, COUNT(*) FROM druid.arrays, UNNEST(arrayLongNulls) AS unnested(uln) WHERE uln IN (1, 2, 3) GROUP BY uln HAVING uln=1; -+-----+--------+ -| uln | EXPR$1 | -+-----+--------+ -| 1 | 5 | -+-----+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalUnnest(unnestExpr=[$0], filter=[=($0, 1)]) - LogicalProject(arrayLongNulls=[$4]) - LogicalTableScan(table=[[druid, arrays]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidUnnest(unnestExpr=[$0], filter=[=($0, 1)]) - DruidProject(arrayLongNulls=[$4], druid=[logical]) - DruidTableScan(table=[[druid, arrays]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "table", - "name" : "arrays" - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "\"arrayLongNulls\"", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "1" - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.unnest", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol.iq similarity index 95% rename from sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq rename to sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol.iq index f89bd0a3e8ca..f91c41816c13 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol.iq @@ -1,4 +1,4 @@ -# testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=sql case-crc:a97b58b2 +# testUnnestWithGroupByHavingWithWhereOnUnnestCol case-crc:a97b58b2 # quidem testcase reason: IMPROVED_PLAN !set debug true !set defaultTimeout 300000 diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=default.iq deleted file mode 100644 index 7fa34f5673a4..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteArraysQueryTest/testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=default.iq +++ /dev/null @@ -1,74 +0,0 @@ -# testUnnestWithGroupByHavingWithWhereOnUnnestCol@NullHandling=default case-crc:a97b58b2 -# quidem testcase reason: IMPROVED_PLAN -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set sqlStringifyArrays false -!set outputformat mysql -!use druidtest:/// -SELECT d3, COUNT(*) FROM druid.numfoo, UNNEST(MV_TO_ARRAY(dim3)) AS unnested(d3) WHERE d3 IN ('a','c') GROUP BY d3 HAVING d3='a'; -+----+--------+ -| d3 | EXPR$1 | -+----+--------+ -| a | 1 | -+----+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'a')]) - LogicalProject(dim3=[$3]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidUnnest(unnestExpr=[MV_TO_ARRAY($0)], filter=[=($0, 'a')]) - DruidProject(dim3=[$3], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "unnest", - "base" : { - "type" : "table", - "name" : "numfoo" - }, - "virtualColumn" : { - "type" : "expression", - "name" : "j0.unnest", - "expression" : "mv_to_array(\"dim3\")", - "outputType" : "ARRAY" - }, - "unnestFilter" : { - "type" : "selector", - "dimension" : "j0.unnest", - "value" : "a" - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "j0.unnest", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq index da22133fb810..43388400085b 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq @@ -22,14 +22,6 @@ INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k (0 rows) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) @@ -37,14 +29,6 @@ LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) @@ -77,10 +61,6 @@ DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) "resultFormat" : "compactedList", "columns" : [ "m1", "v0" ], "columnTypes" : [ "FLOAT", "STRING" ], - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq.orig b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq.orig deleted file mode 100644 index 6b627fdc463a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq.orig +++ /dev/null @@ -1,116 +0,0 @@ -# testInnerJoinCastLeft@all_disabled case-crc:8cd9e460 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default.iq -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) -======= -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_disabled@NullHandling=default.iq - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], -======= - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_disabled.iq - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq index 44493dea9dd9..828fa22013b5 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq @@ -22,14 +22,6 @@ INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k (0 rows) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) @@ -37,10 +29,6 @@ LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) @@ -73,10 +61,6 @@ DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) "resultFormat" : "compactedList", "columns" : [ "m1", "v0" ], "columnTypes" : [ "FLOAT", "STRING" ], - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq.orig b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq.orig deleted file mode 100644 index 0747f2658fe2..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq.orig +++ /dev/null @@ -1,116 +0,0 @@ -# testInnerJoinCastLeft@all_enabled case-crc:57e7eb69 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default.iq -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) -======= -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@all_enabled@NullHandling=default.iq - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], -======= - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@all_enabled.iq - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq index c0effd67eac0..ee4d48e9e4d8 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq @@ -19,14 +19,6 @@ INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k (0 rows) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) @@ -34,14 +26,6 @@ LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) @@ -74,10 +58,6 @@ DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) "resultFormat" : "compactedList", "columns" : [ "m1", "v0" ], "columnTypes" : [ "FLOAT", "STRING" ], - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq.orig b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq.orig deleted file mode 100644 index ccadbe1e1d58..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq.orig +++ /dev/null @@ -1,113 +0,0 @@ -# testInnerJoinCastLeft@default case-crc:55da2e8b -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=default.iq -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) -======= -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@default@NullHandling=default.iq - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], -======= - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@default.iq - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq index 2af4dec2966c..839f2a6c5021 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq @@ -22,14 +22,6 @@ INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k (0 rows) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) @@ -37,14 +29,6 @@ LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) @@ -77,10 +61,6 @@ DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) "resultFormat" : "compactedList", "columns" : [ "m1", "v0" ], "columnTypes" : [ "FLOAT", "STRING" ], - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq.orig b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq.orig deleted file mode 100644 index 9e40a4b4f388..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq.orig +++ /dev/null @@ -1,116 +0,0 @@ -# testInnerJoinCastLeft@filter-on-value-column_disabled case-crc:7f9dea41 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default.iq -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) -======= -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-on-value-column_disabled@NullHandling=default.iq - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], -======= - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-on-value-column_disabled.iq - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq index 4d27bee4f57c..3564d960d0c3 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq @@ -22,14 +22,6 @@ INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k (0 rows) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) @@ -37,14 +29,6 @@ LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) @@ -77,10 +61,6 @@ DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) "resultFormat" : "compactedList", "columns" : [ "m1", "v0" ], "columnTypes" : [ "FLOAT", "STRING" ], - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq.orig b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq.orig deleted file mode 100644 index 5ebca4acddd5..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq.orig +++ /dev/null @@ -1,116 +0,0 @@ -# testInnerJoinCastLeft@filter-rewrites-disabled case-crc:1723b06b -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default.iq -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) -======= -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites-disabled@NullHandling=default.iq - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], -======= - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites-disabled.iq - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq index 541bced06d59..0ece43e5eea7 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq @@ -22,14 +22,6 @@ INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k (0 rows) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) @@ -37,14 +29,6 @@ LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) @@ -77,10 +61,6 @@ DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) "resultFormat" : "compactedList", "columns" : [ "m1", "v0" ], "columnTypes" : [ "FLOAT", "STRING" ], - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq.orig b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq.orig deleted file mode 100644 index 73694c1f1020..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq.orig +++ /dev/null @@ -1,116 +0,0 @@ -# testInnerJoinCastLeft@filter-rewrites case-crc:fb3b0939 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default.iq -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) -======= -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@filter-rewrites@NullHandling=default.iq - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], -======= - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@filter-rewrites.iq - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq index f186e1195be5..d7175feff9e9 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq @@ -22,14 +22,6 @@ INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k (0 rows) !ok -LogicalProject(dim1=[$0], v=[$3]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalFilter(condition=[IS NULL($1)]) - LogicalProject(dim1=[$1], dim2=[$2]) -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalJoin(condition=[=($1, $2)], joinType=[inner]) LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) @@ -37,14 +29,6 @@ LogicalProject(m1=[$0], k=[$2], v=[$3]) LogicalTableScan(table=[[lookup, lookyloo]]) !logicalPlan -DruidProject(dim1=[$0], v=[$3], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidFilter(condition=[IS NULL($1)]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) DruidJoin(condition=[=($1, $2)], joinType=[inner]) DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) @@ -77,10 +61,6 @@ DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) "resultFormat" : "compactedList", "columns" : [ "m1", "v0" ], "columnTypes" : [ "FLOAT", "STRING" ], - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], "granularity" : { "type" : "all" }, diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq.orig b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq.orig deleted file mode 100644 index 4ae9ed118a86..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq.orig +++ /dev/null @@ -1,116 +0,0 @@ -# testInnerJoinCastLeft@join-to-filter case-crc:2b873437 -# quidem testcase reason: JOIN_FILTER_LOCATIONS -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT foo.m1, l.k, l.v -FROM foo -INNER JOIN lookup.lookyloo l ON CAST(foo.m1 AS VARCHAR) = l.k -; -+----+---+---+ -| m1 | k | v | -+----+---+---+ -+----+---+---+ -(0 rows) - -!ok -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default.iq -LogicalProject(dim1=[$0], v=[$2]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[IS NULL($2)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(dim1=[$0], v=[$2], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[IS NULL($2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) -======= -LogicalProject(m1=[$0], k=[$2], v=[$3]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(m1=[$5], m10=[CAST($5):VARCHAR]) - LogicalTableScan(table=[[druid, foo]]) - LogicalTableScan(table=[[lookup, lookyloo]]) - -!logicalPlan -DruidProject(m1=[$0], k=[$2], v=[$3], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(m1=[$5], m10=[CAST($5):VARCHAR], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq - DruidTableScan(table=[[lookup, lookyloo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "CAST(\"m1\", 'STRING')", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithIsNullFilter@join-to-filter@NullHandling=default.iq - "filter" : { - "type" : "selector", - "dimension" : "dim2", - "value" : null - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], -======= - "columns" : [ "m1", "v0" ], - "columnTypes" : [ "FLOAT", "STRING" ], ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinCastLeft@join-to-filter.iq - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "lookup", - "lookup" : "lookyloo" - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.k\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.k", "j0.v" ], - "columnTypes" : [ "FLOAT", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq index d33cc663d698..c19194b0d253 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq @@ -23,34 +23,20 @@ SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2. (1 row) !ok -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq -LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, '')]) -======= LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) LogicalJoin(condition=[=($0, $2)], joinType=[inner]) LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) LogicalFilter(condition=[=($1, '10.1')]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq LogicalTableScan(table=[[druid, foo]]) LogicalProject(dim1=[$1]) LogicalFilter(condition=[=($1, '10.1')]) LogicalTableScan(table=[[druid, foo]]) !logicalPlan -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq -DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) -======= DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) DruidJoin(condition=[=($0, $2)], joinType=[inner]) DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidProject(dim1=[$1], druid=[logical]) DruidFilter(condition=[=($1, '10.1')]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BACKUP_20591.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BACKUP_20591.iq deleted file mode 100644 index d33cc663d698..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BACKUP_20591.iq +++ /dev/null @@ -1,146 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default case-crc:cddd4617 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinLeftTableScanDirect true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq -LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, '')]) -======= -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq -DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) -======= -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "equals", - "column" : "dim1", - "matchValueType" : "STRING", - "matchValue" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "equals", - "column" : "dim1", - "matchValueType" : "STRING", - "matchValue" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BACKUP_21312.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BACKUP_21312.iq deleted file mode 100644 index d33cc663d698..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BACKUP_21312.iq +++ /dev/null @@ -1,146 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default case-crc:cddd4617 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinLeftTableScanDirect true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq -LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, '')]) -======= -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -<<<<<<< HEAD:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractScan@NullHandling=default.iq -DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) -======= -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) ->>>>>>> apache/master:sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default.iq - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "equals", - "column" : "dim1", - "matchValueType" : "STRING", - "matchValue" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "equals", - "column" : "dim1", - "matchValueType" : "STRING", - "matchValue" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BASE_20591.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BASE_20591.iq deleted file mode 100644 index 675d6a757be9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BASE_20591.iq +++ /dev/null @@ -1,131 +0,0 @@ -# testSemiJoinWithOuterTimeExtractScan@NullHandling=default case-crc:f91c4c1d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, EXTRACT(MONTH FROM __time) FROM druid.foo - WHERE dim2 IN ( - SELECT dim2 - FROM druid.foo - WHERE dim1 = 'def' - ) AND dim1 <> ''; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| def | 1 | -+------+--------+ -(1 row) - -!ok -LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[<>($1, '')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[<>($1, '')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "columns" : [ "__time", "dim1", "dim2" ], - "columnTypes" : [ "LONG", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_extract(\"__time\",'MONTH','UTC')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim1", "v0" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BASE_21312.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BASE_21312.iq deleted file mode 100644 index 675d6a757be9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_BASE_21312.iq +++ /dev/null @@ -1,131 +0,0 @@ -# testSemiJoinWithOuterTimeExtractScan@NullHandling=default case-crc:f91c4c1d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, EXTRACT(MONTH FROM __time) FROM druid.foo - WHERE dim2 IN ( - SELECT dim2 - FROM druid.foo - WHERE dim1 = 'def' - ) AND dim1 <> ''; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| def | 1 | -+------+--------+ -(1 row) - -!ok -LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalFilter(condition=[<>($1, '')]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidFilter(condition=[<>($1, '')]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "columns" : [ "__time", "dim1", "dim2" ], - "columnTypes" : [ "LONG", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_extract(\"__time\",'MONTH','UTC')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim1", "v0" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_LOCAL_20591.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_LOCAL_20591.iq deleted file mode 100644 index 364dfc008bd3..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_LOCAL_20591.iq +++ /dev/null @@ -1,131 +0,0 @@ -# testSemiJoinWithOuterTimeExtractScan@NullHandling=default case-crc:f91c4c1d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, EXTRACT(MONTH FROM __time) FROM druid.foo - WHERE dim2 IN ( - SELECT dim2 - FROM druid.foo - WHERE dim1 = 'def' - ) AND dim1 <> ''; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| def | 1 | -+------+--------+ -(1 row) - -!ok -LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "columns" : [ "__time", "dim1", "dim2" ], - "columnTypes" : [ "LONG", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_extract(\"__time\",'MONTH','UTC')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim1", "v0" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_LOCAL_21312.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_LOCAL_21312.iq deleted file mode 100644 index 364dfc008bd3..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_LOCAL_21312.iq +++ /dev/null @@ -1,131 +0,0 @@ -# testSemiJoinWithOuterTimeExtractScan@NullHandling=default case-crc:f91c4c1d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, EXTRACT(MONTH FROM __time) FROM druid.foo - WHERE dim2 IN ( - SELECT dim2 - FROM druid.foo - WHERE dim1 = 'def' - ) AND dim1 <> ''; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| def | 1 | -+------+--------+ -(1 row) - -!ok -LogicalProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[$1], EXPR$1=[EXTRACT(FLAG(MONTH), $0)], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "columns" : [ "__time", "dim1", "dim2" ], - "columnTypes" : [ "LONG", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_extract(\"__time\",'MONTH','UTC')", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "dim1", "v0" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_REMOTE_20591.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_REMOTE_20591.iq deleted file mode 100644 index c19194b0d253..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_REMOTE_20591.iq +++ /dev/null @@ -1,132 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default case-crc:cddd4617 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinLeftTableScanDirect true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "equals", - "column" : "dim1", - "matchValueType" : "STRING", - "matchValue" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "equals", - "column" : "dim1", - "matchValueType" : "STRING", - "matchValue" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_REMOTE_21312.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_REMOTE_21312.iq deleted file mode 100644 index c19194b0d253..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default_REMOTE_21312.iq +++ /dev/null @@ -1,132 +0,0 @@ -# testInnerJoinOnTwoInlineDataSources_withLeftDirectAccess@default case-crc:cddd4617 -# quidem testcase reason: JOIN_LEFT_DIRECT_ACCESS -!set debug true -!set defaultTimeout 300000 -!set enableJoinLeftTableScanDirect true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as -( - SELECT dim1, "__time", m1 from foo WHERE "dim1" = '10.1' -) -SELECT t1.dim1, t1."__time" from abc as t1 INNER JOIN abc as t2 on t1.dim1 = t2.dim1 -; -+------+-------------------------+ -| dim1 | __time | -+------+-------------------------+ -| 10.1 | 2000-01-02 00:00:00.000 | -+------+-------------------------+ -(1 row) - -!ok -LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, '10.1')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$1], druid=[logical]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(dim1=[CAST('10.1':VARCHAR):VARCHAR], __time=[$0], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, '10.1')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "filter" : { - "type" : "equals", - "column" : "dim1", - "matchValueType" : "STRING", - "matchValue" : "10.1" - }, - "columns" : [ "v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "equals", - "column" : "dim1", - "matchValueType" : "STRING", - "matchValue" : "10.1" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"v0\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "_v0", - "expression" : "'10.1'", - "outputType" : "STRING" - } ], - "resultFormat" : "compactedList", - "columns" : [ "_v0", "__time" ], - "columnTypes" : [ "STRING", "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq deleted file mode 100644 index 6d38d618c09a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,273 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_disabled@NullHandling=default case-crc:41547876 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq deleted file mode 100644 index 3e2060932575..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,273 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@all_enabled@NullHandling=default case-crc:edf72f8f -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq deleted file mode 100644 index 02e31c756165..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default.iq +++ /dev/null @@ -1,270 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@default@NullHandling=default case-crc:580b0963 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index b6f2366335a7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,273 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-on-value-column_disabled@NullHandling=default case-crc:cabec9b7 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index ba5f8f1c947b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,273 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites-disabled@NullHandling=default case-crc:32c73cb4 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index dcd84ca7f3cc..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,273 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@filter-rewrites@NullHandling=default case-crc:0cd533f3 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq deleted file mode 100644 index c2d5190ae651..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,273 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersEmptyResults@join-to-filter@NullHandling=default case-crc:bf629ea1 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('A', 'B'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+----+----+ -| m1 | m1 | -+----+----+ -+----+----+ -(0 rows) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, 'A'), =($2, 'B')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "A" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "B" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq deleted file mode 100644 index 1c4316892170..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,274 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_disabled@NullHandling=default case-crc:01ca7eac -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq deleted file mode 100644 index 9548e169cfa7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,274 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@all_enabled@NullHandling=default case-crc:ad692955 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq deleted file mode 100644 index 08ae66426305..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default.iq +++ /dev/null @@ -1,271 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@default@NullHandling=default case-crc:18950fb9 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 1332196099e6..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,274 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-on-value-column_disabled@NullHandling=default case-crc:8a20cf6d -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index c2482d015872..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,274 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites-disabled@NullHandling=default case-crc:72593a6e -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index d1e4c352a62c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,274 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@filter-rewrites@NullHandling=default case-crc:4c4b3529 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 1c471e3a125c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,274 +0,0 @@ -# testInnerJoinWithFilterPushdownAndManyFiltersNonEmptyResults@join-to-filter@NullHandling=default case-crc:fffc987b -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT f1.m1, f2.m1 -FROM foo f1 -INNER JOIN foo f2 ON f1.m1 = f2.m1 where (f1.dim1, f1.dim2) in (('1', 'a'), ('C', 'D'), ('A', 'C'), ('C', 'E'), ('D', 'H'), ('A', 'D'), ('B', 'C'), -('H', 'E'), ('I', 'J'), ('I', 'K'), ('J', 'I'), ('Q', 'R'), ('Q', 'S'), ('S', 'Q'), ('X', 'Y'), ('Z', 'U'), ('U', 'Z'), ('P', 'Q'), ('X', 'A')) -; -+-----+-----+ -| m1 | m1 | -+-----+-----+ -| 4.0 | 4.0 | -+-----+-----+ -(1 row) - -!ok -LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(m1=[$5]) - LogicalFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(m1=[$5]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(m1=[$5], druid=[logical]) - DruidFilter(condition=[OR(AND(=($1, '1'), =($2, 'a')), AND(=($1, 'C'), =($2, 'D')), AND(=($1, 'A'), =($2, 'C')), AND(=($1, 'C'), =($2, 'E')), AND(=($1, 'D'), =($2, 'H')), AND(=($1, 'A'), =($2, 'D')), AND(=($1, 'B'), =($2, 'C')), AND(=($1, 'H'), =($2, 'E')), AND(=($1, 'I'), =($2, 'J')), AND(=($1, 'I'), =($2, 'K')), AND(=($1, 'J'), =($2, 'I')), AND(=($1, 'Q'), =($2, 'R')), AND(=($1, 'Q'), =($2, 'S')), AND(=($1, 'S'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'Y')), AND(=($1, 'Z'), =($2, 'U')), AND(=($1, 'U'), =($2, 'Z')), AND(=($1, 'P'), =($2, 'Q')), AND(=($1, 'X'), =($2, 'A')))]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(m1=[$5], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "scan", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "D" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "C" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "C" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "A", "B" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "E" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "C", "H" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim2", - "value" : "Q" - }, { - "type" : "in", - "dimension" : "dim1", - "values" : [ "P", "S" ] - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "1" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "a" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "D" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "H" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "J" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "I" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "K" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "J" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "I" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "R" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Q" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "S" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Y" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "Z" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "U" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "U" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "Z" - } ] - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "dim1", - "value" : "X" - }, { - "type" : "selector", - "dimension" : "dim2", - "value" : "A" - } ] - } ] - }, - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1" ], - "columnTypes" : [ "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"m1\" == \"j0.m1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "m1", "j0.m1" ], - "columnTypes" : [ "FLOAT", "FLOAT" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition.iq index f27977ca570d..4e32b7d3d689 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testJoinWithInputRefCondition.iq @@ -18,11 +18,10 @@ SELECT COUNT(*) FILTER (WHERE FLOOR(100) NOT IN (SELECT m1 FROM foo)) FROM foo; !ok LogicalAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0]) - LogicalProject($f0=[OR(=($1, 0), AND(IS NULL($4), >=($2, $1)))]) - LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $3)], joinType=[left]) + LogicalProject($f0=[OR(=($8, 0), AND(IS NULL($11), >=($9, $8)))]) + LogicalJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $10)], joinType=[left]) LogicalJoin(condition=[true], joinType=[inner]) - LogicalProject(DUMMY=[0]) - LogicalTableScan(table=[[druid, foo]]) + LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($5)]) LogicalTableScan(table=[[druid, foo]]) LogicalAggregate(group=[{5}], i=[LITERAL_AGG(true)]) @@ -30,11 +29,10 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0]) !logicalPlan DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) - DruidProject($f0=[OR(=($1, 0), AND(IS NULL($4), >=($2, $1)))], druid=[logical]) - DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $3)], joinType=[left]) + DruidProject($f0=[OR(=($8, 0), AND(IS NULL($11), >=($9, $8)))], druid=[logical]) + DruidJoin(condition=[=(CAST(FLOOR(100)):FLOAT NOT NULL, $10)], joinType=[left]) DruidJoin(condition=[true], joinType=[inner]) - DruidProject(DUMMY=[0], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($5)], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) DruidAggregate(group=[{5}], i=[LITERAL_AGG(true)], druid=[logical]) @@ -48,31 +46,8 @@ DruidAggregate(group=[{}], EXPR$0=[COUNT() FILTER $0], druid=[logical]) "left" : { "type" : "join", "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "0", - "outputType" : "LONG" - } ], - "resultFormat" : "compactedList", - "columns" : [ "v0" ], - "columnTypes" : [ "LONG" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } + "type" : "table", + "name" : "foo" }, "right" : { "type" : "query", diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq deleted file mode 100644 index 7740a7ad6807..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@all_disabled@NullHandling=default case-crc:cac513c5 -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq deleted file mode 100644 index c9534c261147..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@all_enabled@NullHandling=default case-crc:5eacffa7 -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq deleted file mode 100644 index c1442a01a12c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default.iq +++ /dev/null @@ -1,156 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@default@NullHandling=default case-crc:35936266 -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 8d0e1e90586a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@filter-on-value-column_disabled@NullHandling=default case-crc:7c6cef9c -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index c73504a79e83..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites-disabled@NullHandling=default case-crc:5d06346f -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index 49b7282e0e54..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@filter-rewrites@NullHandling=default case-crc:1045660d -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq deleted file mode 100644 index cf49a5aa1b63..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,159 +0,0 @@ -# testNestedGroupByOnInlineDataSourceWithFilter@join-to-filter@NullHandling=default case-crc:6cf62e05 -# quidem testcase reason: SCAN_QUERY_ON_FILTERED_DS_DOING_FILTERING -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -with abc as( SELECT dim1, m2 from druid.foo where "__time" >= '2001-01-02'), def as( SELECT t1.dim1, SUM(t2.m2) as "metricSum" from abc as t1 inner join abc as t2 on t1.dim1 = t2.dim1 where t1.dim1='def' group by 1)SELECT count(*) from def; -+--------+ -| EXPR$0 | -+--------+ -| 1 | -+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{}], EXPR$0=[COUNT()]) - LogicalAggregate(group=[{0}]) - LogicalProject(dim1=[CAST('def':VARCHAR):VARCHAR]) - LogicalJoin(condition=[=($0, $1)], joinType=[inner]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(dim1=[$1]) - LogicalFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{}], EXPR$0=[COUNT()], druid=[logical]) - DruidAggregate(group=[{0}], druid=[logical]) - DruidProject(dim1=[CAST('def':VARCHAR):VARCHAR], druid=[logical]) - DruidJoin(condition=[=($0, $1)], joinType=[inner]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(dim1=[$1], druid=[logical]) - DruidFilter(condition=[>=($0, 2001-01-02 00:00:00)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "filter", - "base" : { - "type" : "table", - "name" : "foo" - }, - "filter" : { - "type" : "bound", - "dimension" : "__time", - "lower" : "978393600000", - "ordering" : { - "type" : "numeric" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "2001-01-02T00:00:00.000Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "columns" : [ "dim1" ], - "columnTypes" : [ "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim1\" == \"j0.dim1\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "'def'", - "outputType" : "STRING" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq deleted file mode 100644 index 6f486b9f9479..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_disabled@NullHandling=default case-crc:51e7cf34 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq deleted file mode 100644 index 654255be07f9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@all_enabled@NullHandling=default case-crc:66cfe2c8 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq deleted file mode 100644 index 68151dd0ad2c..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default.iq +++ /dev/null @@ -1,154 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@default@NullHandling=default case-crc:9311cae7 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 1531c7a112b0..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-on-value-column_disabled@NullHandling=default case-crc:f2169f67 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index f26d2df4004b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites-disabled@NullHandling=default case-crc:38c4fa5e -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index f878990edca7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@filter-rewrites@NullHandling=default case-crc:9ff2e870 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 1ec4e43d4e7f..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,157 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingExplicitJoins@join-to-filter@NullHandling=default case-crc:0a72daeb -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM -foo -INNER JOIN (SELECT MAX(__time) t FROM foo) t0 on t0.t = foo.__time -LEFT JOIN (SELECT MIN(__time) t FROM foo) t1 on t1.t = foo.__time -WHERE dim1 IN ('abc', 'def') AND t1.t is null -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[IS NULL($3)]) - LogicalJoin(condition=[=($3, $0)], joinType=[left]) - LogicalJoin(condition=[=($2, $0)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], t=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[IS NULL($3)]) - DruidJoin(condition=[=($0, $3)], joinType=[left]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], t=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "_j0.a0", - "value" : null - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq deleted file mode 100644 index f1bb433af1e6..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_disabled@NullHandling=default case-crc:d7ede89b -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq deleted file mode 100644 index 3ddf82c80826..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@all_enabled@NullHandling=default case-crc:588e02ac -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq deleted file mode 100644 index 394eae7d0cec..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default.iq +++ /dev/null @@ -1,234 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@default@NullHandling=default case-crc:380b2789 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 5ca847ef2d70..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-on-value-column_disabled@NullHandling=default case-crc:13ce8fe9 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 148018b20ab7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites-disabled@NullHandling=default case-crc:833d3669 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index c4917af008d7..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@filter-rewrites@NullHandling=default case-crc:59c3074a -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq deleted file mode 100644 index bce9e35ff71b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,237 +0,0 @@ -# testSemiAndAntiJoinSimultaneouslyUsingWhereInSubquery@join-to-filter@NullHandling=default case-crc:fcf14bf8 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def') -AND __time IN (SELECT MAX(__time) FROM foo) -AND __time NOT IN (SELECT MIN(__time) FROM foo) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - LogicalJoin(condition=[=($0, $5)], joinType=[left]) - LogicalJoin(condition=[true], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalProject(EXPR$0=[$0], i=[true]) - LogicalAggregate(group=[{}], EXPR$0=[MIN($0)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidFilter(condition=[OR(=($3, 0), AND(IS NULL($6), >=($4, $3)))]) - DruidJoin(condition=[=($0, $5)], joinType=[left]) - DruidJoin(condition=[true], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidProject(EXPR$0=[$0], i=[true], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MIN($0)], druid=[logical]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "minTime", - "granularity" : { - "type" : "all" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ ], - "aggregations" : [ { - "type" : "count", - "name" : "_a0" - }, { - "type" : "count", - "name" : "_a1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "1", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeseries", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "aggregations" : [ { - "type" : "longMin", - "name" : "a0", - "fieldName" : "__time" - } ], - "postAggregations" : [ { - "type" : "expression", - "name" : "p0", - "expression" : "1", - "outputType" : "LONG" - } ] - } - }, - "rightPrefix" : "__j0.", - "condition" : "(\"__time\" == \"__j0.a0\")", - "joinType" : "LEFT" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "or", - "fields" : [ { - "type" : "selector", - "dimension" : "_j0._a0", - "value" : "0" - }, { - "type" : "and", - "fields" : [ { - "type" : "selector", - "dimension" : "__j0.p0", - "value" : null - }, { - "type" : "expression", - "expression" : "(\"_j0._a1\" >= \"_j0._a0\")" - } ] - } ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq deleted file mode 100644 index 9f3c3c96865f..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default.iq +++ /dev/null @@ -1,154 +0,0 @@ -# testSemiJoinWithOuterTimeExtractAggregateWithOrderBy@NullHandling=default case-crc:a25a8d86 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT COUNT(DISTINCT dim1), EXTRACT(MONTH FROM __time) FROM druid.foo - WHERE dim2 IN ( - SELECT dim2 - FROM druid.foo - WHERE dim1 = 'def' - ) AND dim1 <> ''GROUP BY EXTRACT(MONTH FROM __time) -ORDER BY EXTRACT(MONTH FROM __time); -+--------+--------+ -| EXPR$0 | EXPR$1 | -+--------+--------+ -| 1 | 1 | -+--------+--------+ -(1 row) - -!ok -LogicalProject(EXPR$0=[$1], EXPR$1=[$0]) - LogicalSort(sort0=[$0], dir0=[ASC]) - LogicalAggregate(group=[{0}], EXPR$0=[COUNT(DISTINCT $1)]) - LogicalProject(EXPR$1=[EXTRACT(FLAG(MONTH), $0)], dim1=[$1]) - LogicalJoin(condition=[=($2, $3)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{2}]) - LogicalFilter(condition=[=($1, 'def')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidProject(EXPR$0=[$1], EXPR$1=[$0], druid=[logical]) - DruidAggregate(group=[{0}], EXPR$0=[COUNT(DISTINCT $1)], druid=[logical]) - DruidProject(EXPR$1=[EXTRACT(FLAG(MONTH), $0)], dim1=[$1], druid=[logical]) - DruidJoin(condition=[=($2, $3)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{2}], druid=[logical]) - DruidFilter(condition=[=($1, 'def')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "columns" : [ "__time", "dim1", "dim2" ], - "columnTypes" : [ "LONG", "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "def" - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "virtualColumns" : [ { - "type" : "expression", - "name" : "v0", - "expression" : "timestamp_extract(\"__time\",'MONTH','UTC')", - "outputType" : "LONG" - } ], - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "v0", - "outputName" : "d0", - "outputType" : "LONG" - } ], - "aggregations" : [ { - "type" : "cardinality", - "name" : "a0", - "fields" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "dim1", - "outputType" : "STRING" - } ], - "byRow" : false, - "round" : true - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq deleted file mode 100644 index 5f625d69ff6b..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@all_disabled@NullHandling=default case-crc:34b41cbf -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq deleted file mode 100644 index 37075b061e40..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@all_enabled@NullHandling=default case-crc:25c89e4f -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq deleted file mode 100644 index 1bcdb99c9891..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@default@NullHandling=default.iq +++ /dev/null @@ -1,162 +0,0 @@ -# testTwoSemiJoinsSimultaneously@default@NullHandling=default case-crc:3372d2de -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index 8940cba96ae4..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@filter-on-value-column_disabled@NullHandling=default case-crc:ede47e22 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index ca34a0e084bb..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@filter-rewrites-disabled@NullHandling=default case-crc:2db0dd99 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index b2bd8ec99739..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@filter-rewrites@NullHandling=default case-crc:dfbbc9bc -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 60a6d1fcc88d..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,165 +0,0 @@ -# testTwoSemiJoinsSimultaneously@join-to-filter@NullHandling=default case-crc:a72f732c -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set enableTimeBoundaryPlanning true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, COUNT(*) FROM foo -WHERE dim1 IN ('abc', 'def')AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt = 1) -AND __time IN (SELECT MAX(__time) FROM foo WHERE cnt <> 2) -GROUP BY 1; -+------+--------+ -| dim1 | EXPR$1 | -+------+--------+ -| abc | 1 | -+------+--------+ -(1 row) - -!ok -LogicalAggregate(group=[{1}], EXPR$1=[COUNT()]) - LogicalJoin(condition=[=($0, $3)], joinType=[inner]) - LogicalJoin(condition=[=($0, $2)], joinType=[inner]) - LogicalProject(__time=[$0], dim1=[$1]) - LogicalFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[=($4, 1)]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{}], EXPR$0=[MAX($0)]) - LogicalFilter(condition=[<>($4, 2)]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidAggregate(group=[{1}], EXPR$1=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($0, $3)], joinType=[inner]) - DruidJoin(condition=[=($0, $2)], joinType=[inner]) - DruidProject(__time=[$0], dim1=[$1], druid=[logical]) - DruidFilter(condition=[SEARCH($1, Sarg['abc':VARCHAR, 'def':VARCHAR]:VARCHAR)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[=($4, 1)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{}], EXPR$0=[MAX($0)], druid=[logical]) - DruidFilter(condition=[<>($4, 2)]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "in", - "dimension" : "dim1", - "values" : [ "abc", "def" ] - }, - "columns" : [ "__time", "dim1" ], - "columnTypes" : [ "LONG", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "1" - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"__time\" == \"j0.a0\")", - "joinType" : "INNER" - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "timeBoundary", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "bound" : "maxTime", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "cnt", - "value" : "2" - } - }, - "granularity" : { - "type" : "all" - } - } - }, - "rightPrefix" : "_j0.", - "condition" : "(\"__time\" == \"_j0.a0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq deleted file mode 100644 index 6f1fb9a7f431..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@all_disabled@NullHandling=default case-crc:5416b44a -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, 'xxx')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, 'xxx')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq deleted file mode 100644 index 3b36bd704946..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@all_enabled@NullHandling=default case-crc:a7bb9ccc -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, 'xxx')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, 'xxx')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq deleted file mode 100644 index e9c664d48d03..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default.iq +++ /dev/null @@ -1,149 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@default@NullHandling=default case-crc:18fc370a -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, 'xxx')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, 'xxx')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq deleted file mode 100644 index cb7942249a9a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@filter-on-value-column_disabled@NullHandling=default case-crc:ce3a443c -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, 'xxx')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, 'xxx')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq deleted file mode 100644 index 711e704cc4d9..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@filter-rewrites-disabled@NullHandling=default case-crc:7acb032c -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, 'xxx')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, 'xxx')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq deleted file mode 100644 index af0fb0a20d7a..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@filter-rewrites@NullHandling=default case-crc:d83db91a -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite true -!set enableJoinFilterRewriteValueColumnFilters true -!set enableRewriteJoinToFilter false -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, 'xxx')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, 'xxx')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq deleted file mode 100644 index 9e92c8c5278e..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteJoinQueryTest/testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default.iq +++ /dev/null @@ -1,152 +0,0 @@ -# testUsingSubqueryAsPartOfAndFilter@join-to-filter@NullHandling=default case-crc:d70bc6c4 -# quidem testcase reason: SLIGHTLY_WORSE_FILTER_PUSHED_TO_JOIN_OPERAND -!set debug true -!set defaultTimeout 300000 -!set enableJoinFilterRewrite false -!set enableJoinFilterRewriteValueColumnFilters false -!set enableRewriteJoinToFilter true -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT dim1, dim2, COUNT(*) FROM druid.foo -WHERE dim2 IN (SELECT dim1 FROM druid.foo WHERE dim1 <> '') -AND dim1 <> 'xxx' -group by dim1, dim2 ORDER BY dim2; -+------+------+--------+ -| dim1 | dim2 | EXPR$2 | -+------+------+--------+ -| def | abc | 1 | -+------+------+--------+ -(1 row) - -!ok -LogicalSort(sort0=[$1], dir0=[ASC]) - LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT()]) - LogicalJoin(condition=[=($1, $2)], joinType=[inner]) - LogicalProject(dim1=[$1], dim2=[$2]) - LogicalFilter(condition=[<>($1, 'xxx')]) - LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{1}]) - LogicalFilter(condition=[<>($1, '')]) - LogicalTableScan(table=[[druid, foo]]) - -!logicalPlan -DruidSort(sort0=[$1], dir0=[ASC], druid=[logical]) - DruidAggregate(group=[{0, 1}], EXPR$2=[COUNT()], druid=[logical]) - DruidJoin(condition=[=($1, $2)], joinType=[inner]) - DruidProject(dim1=[$1], dim2=[$2], druid=[logical]) - DruidFilter(condition=[<>($1, 'xxx')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{1}], druid=[logical]) - DruidFilter(condition=[<>($1, '')]) - DruidTableScan(table=[[druid, foo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "join", - "left" : { - "type" : "query", - "query" : { - "queryType" : "scan", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "resultFormat" : "compactedList", - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : "xxx" - } - }, - "columns" : [ "dim1", "dim2" ], - "columnTypes" : [ "STRING", "STRING" ], - "granularity" : { - "type" : "all" - }, - "legacy" : false - } - }, - "right" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "foo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "filter" : { - "type" : "not", - "field" : { - "type" : "selector", - "dimension" : "dim1", - "value" : null - } - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "rightPrefix" : "j0.", - "condition" : "(\"dim2\" == \"j0.d0\")", - "joinType" : "INNER" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "d0", - "outputType" : "STRING" - }, { - "type" : "default", - "dimension" : "dim2", - "outputName" : "d1", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "count", - "name" : "a0" - } ], - "limitSpec" : { - "type" : "default", - "columns" : [ { - "dimension" : "d1", - "direction" : "ascending", - "dimensionOrder" : { - "type" : "lexicographic" - } - } ] - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq index da905b0336c1..65cce7cc14b4 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testGroupByWithLiteralInSubqueryGrouping.iq @@ -30,8 +30,8 @@ SELECT +-------+----+ | t1 | t2 | +-------+----+ -| dummy | | | dummy | b | +| dummy | | +-------+----+ (2 rows) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin.iq index 703a00c0d23a..da50aed8e468 100644 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin.iq +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testMultipleExactCountDistinctWithGroupingAndOtherAggregatorsUsingJoin.iq @@ -29,7 +29,7 @@ LogicalProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5]) LogicalAggregate(group=[{1}], EXPR$2=[COUNT($0)]) LogicalAggregate(group=[{1, 2}]) LogicalTableScan(table=[[druid, foo]]) - LogicalAggregate(group=[{0}], EXPR$3=[COUNT()]) + LogicalAggregate(group=[{0}], EXPR$3=[COUNT($1)]) LogicalAggregate(group=[{2, 4}]) LogicalTableScan(table=[[druid, foo]]) @@ -42,7 +42,7 @@ DruidProject(dim2=[$0], EXPR$1=[$1], EXPR$2=[$3], EXPR$3=[$5], druid=[logical]) DruidAggregate(group=[{1}], EXPR$2=[COUNT($0)], druid=[logical]) DruidAggregate(group=[{1, 2}], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) - DruidAggregate(group=[{0}], EXPR$3=[COUNT()], druid=[logical]) + DruidAggregate(group=[{0}], EXPR$3=[COUNT($1)], druid=[logical]) DruidAggregate(group=[{2, 4}], druid=[logical]) DruidTableScan(table=[[druid, foo]], druid=[logical]) diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals.iq deleted file mode 100644 index a2f6deeb97dc..000000000000 --- a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testSubqueryTypeMismatchWithLiterals.iq +++ /dev/null @@ -1,111 +0,0 @@ -# testSubqueryTypeMismatchWithLiterals case-crc:e7079756 -# quidem testcase reason: AGGREGATE_REMOVE_NOT_FIRED -!set debug true -!set defaultTimeout 300000 -!set maxScatterGatherBytes 9223372036854775807 -!set plannerStrategy DECOUPLED -!set sqlCurrentTimestamp 2000-01-01T00:00:00Z -!set sqlQueryId dummy -!set outputformat mysql -!use druidtest:/// -SELECT - dim1, - SUM(CASE WHEN sum_l1 = 0 THEN 1 ELSE 0 END) AS outer_l1 -from ( - select - dim1, - SUM(l1) as sum_l1 - from numfoo - group by dim1 -) -group by 1; -+------+----------+ -| dim1 | outer_l1 | -+------+----------+ -| | 0 | -| 1 | 0 | -| 10.1 | 0 | -| 2 | 1 | -| abc | 0 | -| def | 0 | -+------+----------+ -(6 rows) - -!ok -LogicalAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1]) - LogicalProject(dim1=[$0], $f2=[IS TRUE(=($1, 0))]) - LogicalAggregate(group=[{1}], sum_l1=[SUM($11)]) - LogicalTableScan(table=[[druid, numfoo]]) - -!logicalPlan -DruidAggregate(group=[{0}], outer_l1=[COUNT() FILTER $1], druid=[logical]) - DruidProject(dim1=[$0], $f2=[IS TRUE(=($1, 0))], druid=[logical]) - DruidAggregate(group=[{1}], sum_l1=[SUM($11)], druid=[logical]) - DruidTableScan(table=[[druid, numfoo]], druid=[logical]) - -!druidPlan -{ - "queryType" : "groupBy", - "dataSource" : { - "type" : "query", - "query" : { - "queryType" : "groupBy", - "dataSource" : { - "type" : "table", - "name" : "numfoo" - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "dim1", - "outputName" : "_d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "longSum", - "name" : "a0", - "fieldName" : "l1" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } - } - }, - "intervals" : { - "type" : "intervals", - "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] - }, - "granularity" : { - "type" : "all" - }, - "dimensions" : [ { - "type" : "default", - "dimension" : "_d0", - "outputName" : "d0", - "outputType" : "STRING" - } ], - "aggregations" : [ { - "type" : "filtered", - "aggregator" : { - "type" : "count", - "name" : "_a0" - }, - "filter" : { - "type" : "equals", - "column" : "a0", - "matchValueType" : "LONG", - "matchValue" : 0 - }, - "name" : "_a0" - } ], - "limitSpec" : { - "type" : "NoopLimitSpec" - } -} -!nativePlan diff --git a/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery.iq b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery.iq new file mode 100644 index 000000000000..78cfc255ca94 --- /dev/null +++ b/sql/src/test/quidem/org.apache.druid.sql.calcite.DecoupledPlanningCalciteQueryTest/testTimeFilterOnSubquery.iq @@ -0,0 +1,88 @@ +# testTimeFilterOnSubquery case-crc:73448efc +# quidem testcase reason: EQUIV_PLAN_EXTRA_COLUMNS +!set debug true +!set defaultTimeout 300000 +!set maxScatterGatherBytes 9223372036854775807 +!set plannerStrategy DECOUPLED +!set sqlCurrentTimestamp 2000-01-01T00:00:00Z +!set sqlQueryId dummy +!set outputformat mysql +!use druidtest:/// +SELECT __time, m1 FROM (SELECT * FROM "foo" LIMIT 100) +WHERE TIME_IN_INTERVAL(__time, '2000/P1D') OR TIME_IN_INTERVAL(__time, '2001/P1D'); ++-------------------------+-----+ +| __time | m1 | ++-------------------------+-----+ +| 2000-01-01 00:00:00.000 | 1.0 | +| 2001-01-01 00:00:00.000 | 4.0 | ++-------------------------+-----+ +(2 rows) + +!ok +LogicalFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) + LogicalSort(fetch=[100]) + LogicalProject(__time=[$0], m1=[$5]) + LogicalTableScan(table=[[druid, foo]]) + +!logicalPlan +DruidFilter(condition=[SEARCH($0, Sarg[[2000-01-01 00:00:00:TIMESTAMP(3)..2000-01-02 00:00:00:TIMESTAMP(3)), [2001-01-01 00:00:00:TIMESTAMP(3)..2001-01-02 00:00:00:TIMESTAMP(3))]:TIMESTAMP(3))]) + DruidSort(fetch=[100], druid=[logical]) + DruidProject(__time=[$0], m1=[$5], druid=[logical]) + DruidTableScan(table=[[druid, foo]], druid=[logical]) + +!druidPlan +{ + "queryType" : "scan", + "dataSource" : { + "type" : "query", + "query" : { + "queryType" : "scan", + "dataSource" : { + "type" : "table", + "name" : "foo" + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "resultFormat" : "compactedList", + "limit" : 100, + "columns" : [ "__time", "m1" ], + "columnTypes" : [ "LONG", "FLOAT" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false + } + }, + "intervals" : { + "type" : "intervals", + "intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ] + }, + "resultFormat" : "compactedList", + "filter" : { + "type" : "or", + "fields" : [ { + "type" : "range", + "column" : "__time", + "matchValueType" : "LONG", + "lower" : 946684800000, + "upper" : 946771200000, + "upperOpen" : true + }, { + "type" : "range", + "column" : "__time", + "matchValueType" : "LONG", + "lower" : 978307200000, + "upper" : 978393600000, + "upperOpen" : true + } ] + }, + "columns" : [ "__time", "m1" ], + "columnTypes" : [ "LONG", "FLOAT" ], + "granularity" : { + "type" : "all" + }, + "legacy" : false +} +!nativePlan From d1106cc7c6c3c04dbeb1c78228b120141821b679 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Fri, 10 Jan 2025 14:22:29 +0000 Subject: [PATCH 99/99] fix --- .../org/apache/druid/sql/calcite/CalciteArraysQueryTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java index 07ea20f9cc17..652b7e831d0c 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteArraysQueryTest.java @@ -4524,6 +4524,7 @@ public void testUnnestTwiceWithFiltersAndExpressions() } @NotYetSupported(Modes.UNNEST_RESULT_MISMATCH) + @DecoupledTestConfig(ignoreExpectedQueriesReason = IgnoreQueriesReason.UNNEST_EXTRA_SCANQUERY) @Test public void testUnnestThriceWithFiltersOnDimAndUnnestCol() {