From b2f1f698ee8978aa4d6c7b54c147ad7fe35aa0e4 Mon Sep 17 00:00:00 2001 From: Karol Sobczak Date: Wed, 10 Mar 2021 17:41:03 +0100 Subject: [PATCH] Introduce TableScanNode#useConnectorNodePartitioning This commit introduces TableScanNode#useConnectorNodePartitioning which will be used by optimizer rule to specify if node partitioning should be used for table scan. --- .../io/trino/sql/planner/LogicalPlanner.java | 2 +- .../java/io/trino/sql/planner/PlanCopier.java | 2 +- .../io/trino/sql/planner/PlanFragmenter.java | 5 ++- .../io/trino/sql/planner/RelationPlanner.java | 2 +- .../rule/ApplyTableScanRedirection.java | 6 ++- .../iterative/rule/PruneTableScanColumns.java | 3 +- .../rule/PushAggregationIntoTableScan.java | 4 +- .../iterative/rule/PushJoinIntoTableScan.java | 3 +- .../rule/PushLimitIntoTableScan.java | 6 ++- .../rule/PushPredicateIntoTableScan.java | 3 +- .../rule/PushProjectionIntoTableScan.java | 3 +- .../rule/PushSampleIntoTableScan.java | 6 ++- .../iterative/rule/PushTopNIntoTableScan.java | 5 ++- .../optimizations/BeginTableWrite.java | 4 +- .../UnaliasSymbolReferences.java | 2 +- .../trino/sql/planner/plan/TableScanNode.java | 40 +++++++++++++++++-- .../io/trino/cost/TestCostCalculator.java | 3 +- .../execution/MockRemoteTaskFactory.java | 3 +- .../io/trino/execution/TaskTestUtils.java | 3 +- .../TestPhasedExecutionSchedule.java | 6 ++- .../TestSourcePartitionedScheduler.java | 3 +- .../server/TestDynamicFilterService.java | 3 +- .../TestEffectivePredicateExtractor.java | 27 ++++++++----- .../trino/sql/planner/TestTypeValidator.java | 3 +- .../iterative/rule/test/PlanBuilder.java | 9 +++-- 25 files changed, 116 insertions(+), 40 deletions(-) diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/LogicalPlanner.java b/core/trino-main/src/main/java/io/trino/sql/planner/LogicalPlanner.java index 6732978cd69d..cf782eed104a 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/LogicalPlanner.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/LogicalPlanner.java @@ -319,7 +319,7 @@ private RelationPlan createAnalyzePlan(Analysis analysis, Analyze analyzeStateme idAllocator.getNextId(), new AggregationNode( idAllocator.getNextId(), - TableScanNode.newInstance(idAllocator.getNextId(), targetTable, tableScanOutputs.build(), symbolToColumnHandle.build(), false), + TableScanNode.newInstance(idAllocator.getNextId(), targetTable, tableScanOutputs.build(), symbolToColumnHandle.build(), false, Optional.empty()), statisticAggregations.getAggregations(), singleGroupingSet(groupingSymbols), ImmutableList.of(), diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/PlanCopier.java b/core/trino-main/src/main/java/io/trino/sql/planner/PlanCopier.java index 8610b904b9f9..aca03221b949 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/PlanCopier.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/PlanCopier.java @@ -120,7 +120,7 @@ public PlanNode visitSample(SampleNode node, RewriteContext context) @Override public PlanNode visitTableScan(TableScanNode node, RewriteContext context) { - return new TableScanNode(idAllocator.getNextId(), node.getTable(), node.getOutputSymbols(), node.getAssignments(), node.getEnforcedConstraint(), node.isUpdateTarget()); + return new TableScanNode(idAllocator.getNextId(), node.getTable(), node.getOutputSymbols(), node.getAssignments(), node.getEnforcedConstraint(), node.isUpdateTarget(), node.getUseConnectorNodePartitioning()); } @Override diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/PlanFragmenter.java b/core/trino-main/src/main/java/io/trino/sql/planner/PlanFragmenter.java index ccf81adf0a5e..d6fd6f24a7de 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/PlanFragmenter.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/PlanFragmenter.java @@ -786,7 +786,10 @@ public PlanNode visitTableScan(TableScanNode node, RewriteContext context) node.getOutputSymbols(), node.getAssignments(), node.getEnforcedConstraint(), - node.isUpdateTarget()); + node.isUpdateTarget(), + // plan was already fragmented with scan node's partitioning + // and new partitioning is compatible with previous one + node.getUseConnectorNodePartitioning()); } } } diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/RelationPlanner.java b/core/trino-main/src/main/java/io/trino/sql/planner/RelationPlanner.java index acdd2e09716b..5fc5e0dc825e 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/RelationPlanner.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/RelationPlanner.java @@ -203,7 +203,7 @@ protected RelationPlan visitTable(Table node, Void context) List outputSymbols = outputSymbolsBuilder.build(); boolean updateTarget = analysis.isUpdateTarget(node); - PlanNode root = TableScanNode.newInstance(idAllocator.getNextId(), handle, outputSymbols, columns.build(), updateTarget); + PlanNode root = TableScanNode.newInstance(idAllocator.getNextId(), handle, outputSymbols, columns.build(), updateTarget, Optional.empty()); plan = new RelationPlan(root, scope, outputSymbols, outerContext); } diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/ApplyTableScanRedirection.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/ApplyTableScanRedirection.java index 6e91a02b1bf1..1f9ae15dec7f 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/ApplyTableScanRedirection.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/ApplyTableScanRedirection.java @@ -138,7 +138,8 @@ public Result apply(TableScanNode scanNode, Captures captures, Context context) scanNode.getOutputSymbols(), newAssignments, TupleDomain.all(), - scanNode.isUpdateTarget())); + scanNode.isUpdateTarget(), + Optional.empty())); } ImmutableMap.Builder newAssignmentsBuilder = ImmutableMap.builder() @@ -189,7 +190,8 @@ public Result apply(TableScanNode scanNode, Captures captures, Context context) newOutputSymbols, newAssignmentsBuilder.build(), TupleDomain.all(), - scanNode.isUpdateTarget()); + scanNode.isUpdateTarget(), + Optional.empty()); FilterNode filterNode = new FilterNode( context.getIdAllocator().getNextId(), diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PruneTableScanColumns.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PruneTableScanColumns.java index b0b392fab77f..979ec4b53d47 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PruneTableScanColumns.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PruneTableScanColumns.java @@ -116,6 +116,7 @@ public static Optional pruneColumns(Metadata metadata, TypeProvider ty newOutputs, newAssignments, enforcedConstraint, - node.isUpdateTarget())); + node.isUpdateTarget(), + node.getUseConnectorNodePartitioning())); } } diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java index a01673d539f6..8f5a7eeeb5ff 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java @@ -204,7 +204,9 @@ public static Optional pushAggregationIntoTableScan( result.getHandle(), newScanOutputs.build(), scanAssignments, - tableScan.isUpdateTarget()), + tableScan.isUpdateTarget(), + // table scan partitioning might have changed with new table handle + Optional.empty()), assignmentBuilder.build())); } diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushJoinIntoTableScan.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushJoinIntoTableScan.java index 292769d81b77..7eb374fba172 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushJoinIntoTableScan.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushJoinIntoTableScan.java @@ -194,7 +194,8 @@ public Result apply(JoinNode joinNode, Captures captures, Context context) ImmutableList.copyOf(assignments.keySet()), assignments, newEnforcedConstraint, - false), + false, + Optional.empty()), Assignments.identity(joinNode.getOutputSymbols()))); } diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushLimitIntoTableScan.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushLimitIntoTableScan.java index aa45f5978abf..4776cb5e09dd 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushLimitIntoTableScan.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushLimitIntoTableScan.java @@ -23,6 +23,8 @@ import io.trino.sql.planner.plan.PlanNode; import io.trino.sql.planner.plan.TableScanNode; +import java.util.Optional; + import static io.trino.SystemSessionProperties.isAllowPushdownIntoConnectors; import static io.trino.matching.Capture.newCapture; import static io.trino.sql.planner.plan.Patterns.limit; @@ -70,7 +72,9 @@ public Rule.Result apply(LimitNode limit, Captures captures, Rule.Context contex tableScan.getOutputSymbols(), tableScan.getAssignments(), tableScan.getEnforcedConstraint(), - tableScan.isUpdateTarget()); + tableScan.isUpdateTarget(), + // table scan partitioning might have changed with new table handle + Optional.empty()); if (!result.isLimitGuaranteed()) { node = new LimitNode(limit.getId(), node, limit.getCount(), limit.isPartial()); diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushPredicateIntoTableScan.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushPredicateIntoTableScan.java index e086f5b3dd49..0b24ce5fd714 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushPredicateIntoTableScan.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushPredicateIntoTableScan.java @@ -260,7 +260,8 @@ public static Optional pushFilterIntoTableScan( node.getOutputSymbols(), node.getAssignments(), computeEnforced(newDomain, remainingFilter), - node.isUpdateTarget()); + node.isUpdateTarget(), + Optional.empty()); Expression resultingPredicate = createResultingPredicate( metadata, diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushProjectionIntoTableScan.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushProjectionIntoTableScan.java index aa5f3af76b2d..9f04d086342a 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushProjectionIntoTableScan.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushProjectionIntoTableScan.java @@ -162,7 +162,8 @@ public Result apply(ProjectNode project, Captures captures, Context context) result.get().getHandle(), newScanOutputs, newScanAssignments, - tableScan.isUpdateTarget()), + tableScan.isUpdateTarget(), + Optional.empty()), newProjectionAssignments.build())); } } diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushSampleIntoTableScan.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushSampleIntoTableScan.java index be0953d21fbf..a6e874d888ee 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushSampleIntoTableScan.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushSampleIntoTableScan.java @@ -24,6 +24,8 @@ import io.trino.sql.planner.plan.SampleNode.Type; import io.trino.sql.planner.plan.TableScanNode; +import java.util.Optional; + import static io.trino.SystemSessionProperties.isAllowPushdownIntoConnectors; import static io.trino.matching.Capture.newCapture; import static io.trino.sql.planner.plan.Patterns.Sample.sampleType; @@ -70,7 +72,9 @@ public Rule.Result apply(SampleNode sample, Captures captures, Rule.Context cont tableScan.getOutputSymbols(), tableScan.getAssignments(), tableScan.getEnforcedConstraint(), - tableScan.isUpdateTarget()))) + tableScan.isUpdateTarget(), + // table scan partitioning might have changed with new table handle + Optional.empty()))) .orElseGet(Result::empty); } diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushTopNIntoTableScan.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushTopNIntoTableScan.java index f7bf098da56a..96fe58c40231 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushTopNIntoTableScan.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushTopNIntoTableScan.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Map; +import java.util.Optional; import static com.google.common.collect.ImmutableMap.toImmutableMap; import static io.trino.SystemSessionProperties.isAllowPushdownIntoConnectors; @@ -86,7 +87,9 @@ public Result apply(TopNNode topNNode, Captures captures, Context context) result.getHandle(), tableScan.getOutputSymbols(), tableScan.getAssignments(), - tableScan.isUpdateTarget()); + tableScan.isUpdateTarget(), + // table scan partitioning might have changed with new table handle + Optional.empty()); if (!result.isTopNGuaranteed()) { node = topNNode.replaceChildren(ImmutableList.of(node)); diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/BeginTableWrite.java b/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/BeginTableWrite.java index fae5d145850a..caec54d1ef30 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/BeginTableWrite.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/BeginTableWrite.java @@ -269,7 +269,9 @@ private PlanNode rewriteModifyTableScan(PlanNode node, TableHandle handle) scan.getOutputSymbols(), scan.getAssignments(), scan.getEnforcedConstraint(), - scan.isUpdateTarget()); + scan.isUpdateTarget(), + // partitioning should not change with write table handle + scan.getUseConnectorNodePartitioning()); } if (node instanceof FilterNode) { diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/UnaliasSymbolReferences.java b/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/UnaliasSymbolReferences.java index 46f0a165c312..819896463742 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/UnaliasSymbolReferences.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/optimizations/UnaliasSymbolReferences.java @@ -286,7 +286,7 @@ public PlanAndMappings visitTableScan(TableScanNode node, UnaliasContext context }); return new PlanAndMappings( - new TableScanNode(node.getId(), node.getTable(), newOutputs, newAssignments, node.getEnforcedConstraint(), node.isUpdateTarget()), + new TableScanNode(node.getId(), node.getTable(), newOutputs, newAssignments, node.getEnforcedConstraint(), node.isUpdateTarget(), node.getUseConnectorNodePartitioning()), mapping); } diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableScanNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableScanNode.java index e2251e61efa8..e5f50ae47bda 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableScanNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/TableScanNode.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.VerifyException; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import io.trino.metadata.TableHandle; @@ -26,6 +27,7 @@ import java.util.List; import java.util.Map; +import java.util.Optional; import static com.google.common.base.MoreObjects.toStringHelper; import static com.google.common.base.Preconditions.checkArgument; @@ -42,6 +44,7 @@ public class TableScanNode private final TupleDomain enforcedConstraint; private final boolean updateTarget; + private final Optional useConnectorNodePartitioning; // We need this factory method to disambiguate with the constructor used for deserializing // from a json object. The deserializer sets some fields which are never transported @@ -51,9 +54,10 @@ public static TableScanNode newInstance( TableHandle table, List outputs, Map assignments, - boolean updateTarget) + boolean updateTarget, + Optional useConnectorNodePartitioning) { - return new TableScanNode(id, table, outputs, assignments, TupleDomain.all(), updateTarget); + return new TableScanNode(id, table, outputs, assignments, TupleDomain.all(), updateTarget, useConnectorNodePartitioning); } /* @@ -67,7 +71,8 @@ public TableScanNode( @JsonProperty("table") TableHandle table, @JsonProperty("outputSymbols") List outputs, @JsonProperty("assignments") Map assignments, - @JsonProperty("updateTarget") boolean updateTarget) + @JsonProperty("updateTarget") boolean updateTarget, + @JsonProperty("useConnectorNodePartitioning") Optional useConnectorNodePartitioning) { super(id); this.table = requireNonNull(table, "table is null"); @@ -76,6 +81,7 @@ public TableScanNode( checkArgument(assignments.keySet().containsAll(outputs), "assignments does not cover all of outputs"); this.enforcedConstraint = null; this.updateTarget = updateTarget; + this.useConnectorNodePartitioning = requireNonNull(useConnectorNodePartitioning, "useConnectorNodePartitioning is null"); } public TableScanNode( @@ -84,7 +90,8 @@ public TableScanNode( List outputs, Map assignments, TupleDomain enforcedConstraint, - boolean updateTarget) + boolean updateTarget, + Optional useConnectorNodePartitioning) { super(id); this.table = requireNonNull(table, "table is null"); @@ -93,6 +100,7 @@ public TableScanNode( checkArgument(assignments.keySet().containsAll(outputs), "assignments does not cover all of outputs"); this.enforcedConstraint = requireNonNull(enforcedConstraint, "enforcedConstraint is null"); this.updateTarget = updateTarget; + this.useConnectorNodePartitioning = requireNonNull(useConnectorNodePartitioning, "useTableNodePartitioning is null"); } @JsonProperty("table") @@ -135,6 +143,18 @@ public boolean isUpdateTarget() return updateTarget; } + @JsonProperty("useConnectorNodePartitioning") + public Optional getUseConnectorNodePartitioning() + { + return useConnectorNodePartitioning; + } + + public boolean isUseConnectorNodePartitioning() + { + return useConnectorNodePartitioning + .orElseThrow(() -> new VerifyException("useConnectorNodePartitioning is not present")); + } + @Override public List getSources() { @@ -165,4 +185,16 @@ public PlanNode replaceChildren(List newChildren) checkArgument(newChildren.isEmpty(), "newChildren is not empty"); return this; } + + public TableScanNode withUseConnectorNodePartitioning(boolean useConnectorNodePartitioning) + { + return new TableScanNode( + getId(), + table, + outputSymbols, + assignments, + enforcedConstraint, + updateTarget, + Optional.of(useConnectorNodePartitioning)); + } } diff --git a/core/trino-main/src/test/java/io/trino/cost/TestCostCalculator.java b/core/trino-main/src/test/java/io/trino/cost/TestCostCalculator.java index 6ef17500f77b..431a3aa714e4 100644 --- a/core/trino-main/src/test/java/io/trino/cost/TestCostCalculator.java +++ b/core/trino-main/src/test/java/io/trino/cost/TestCostCalculator.java @@ -797,7 +797,8 @@ private TableScanNode tableScan(String id, String... symbols) symbolsList, assignments.build(), TupleDomain.all(), - false); + false, + Optional.empty()); } private PlanNode project(String id, PlanNode source, String symbol, Expression expression) diff --git a/core/trino-main/src/test/java/io/trino/execution/MockRemoteTaskFactory.java b/core/trino-main/src/test/java/io/trino/execution/MockRemoteTaskFactory.java index c43946a82a4c..61d3073affb4 100644 --- a/core/trino-main/src/test/java/io/trino/execution/MockRemoteTaskFactory.java +++ b/core/trino-main/src/test/java/io/trino/execution/MockRemoteTaskFactory.java @@ -112,7 +112,8 @@ public MockRemoteTask createTableScanTask(TaskId taskId, InternalNode newNode, L TEST_TABLE_HANDLE, ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), - false), + false, + Optional.empty()), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(sourceId), diff --git a/core/trino-main/src/test/java/io/trino/execution/TaskTestUtils.java b/core/trino-main/src/test/java/io/trino/execution/TaskTestUtils.java index e2190e938e6c..bb605f995b51 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TaskTestUtils.java +++ b/core/trino-main/src/test/java/io/trino/execution/TaskTestUtils.java @@ -92,7 +92,8 @@ private TaskTestUtils() {} TEST_TABLE_HANDLE, ImmutableList.of(SYMBOL), ImmutableMap.of(SYMBOL, new TestingColumnHandle("column", 0, BIGINT)), - false), + false, + Optional.empty()), ImmutableMap.of(SYMBOL, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(TABLE_SCAN_NODE_ID), diff --git a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestPhasedExecutionSchedule.java b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestPhasedExecutionSchedule.java index 9f99b2312c13..b72254e1a51d 100644 --- a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestPhasedExecutionSchedule.java +++ b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestPhasedExecutionSchedule.java @@ -182,7 +182,8 @@ private static PlanFragment createBroadcastJoinPlanFragment(String name, PlanFra TEST_TABLE_HANDLE, ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), - false); + false, + Optional.empty()); RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("build_id"), buildFragment.getId(), ImmutableList.of(), Optional.empty(), REPLICATE); PlanNode join = new JoinNode( @@ -236,7 +237,8 @@ private static PlanFragment createTableScanPlanFragment(String name) TEST_TABLE_HANDLE, ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), - false); + false, + Optional.empty()); return createFragment(planNode); } diff --git a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSourcePartitionedScheduler.java b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSourcePartitionedScheduler.java index d89cedd0e475..d4f0c4a5e86b 100644 --- a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSourcePartitionedScheduler.java +++ b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSourcePartitionedScheduler.java @@ -570,7 +570,8 @@ private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) TEST_TABLE_HANDLE, ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), - false); + false, + Optional.empty()); FilterNode filterNode = new FilterNode( new PlanNodeId("filter_node_id"), tableScan, diff --git a/core/trino-main/src/test/java/io/trino/server/TestDynamicFilterService.java b/core/trino-main/src/test/java/io/trino/server/TestDynamicFilterService.java index be75911f886f..4cc365559133 100644 --- a/core/trino-main/src/test/java/io/trino/server/TestDynamicFilterService.java +++ b/core/trino-main/src/test/java/io/trino/server/TestDynamicFilterService.java @@ -653,7 +653,8 @@ private static PlanFragment createPlan(DynamicFilterId dynamicFilterId, Partitio TEST_TABLE_HANDLE, ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingMetadata.TestingColumnHandle("column")), - false); + false, + Optional.empty()); FilterNode filterNode = new FilterNode( new PlanNodeId("filter_node_id"), tableScan, diff --git a/core/trino-main/src/test/java/io/trino/sql/planner/TestEffectivePredicateExtractor.java b/core/trino-main/src/test/java/io/trino/sql/planner/TestEffectivePredicateExtractor.java index 93f192176464..a692ffd37835 100644 --- a/core/trino-main/src/test/java/io/trino/sql/planner/TestEffectivePredicateExtractor.java +++ b/core/trino-main/src/test/java/io/trino/sql/planner/TestEffectivePredicateExtractor.java @@ -226,7 +226,8 @@ public void setUp() makeTableHandle(TupleDomain.all()), ImmutableList.copyOf(assignments.keySet()), assignments, - false); + false, + Optional.empty()); expressionNormalizer = new ExpressionIdentityNormalizer(); } @@ -503,7 +504,8 @@ public void testTableScan() makeTableHandle(TupleDomain.all()), ImmutableList.copyOf(assignments.keySet()), assignments, - false); + false, + Optional.empty()); Expression effectivePredicate = effectivePredicateExtractor.extract(SESSION, node, TypeProvider.empty(), typeAnalyzer); assertEquals(effectivePredicate, BooleanLiteral.TRUE_LITERAL); @@ -513,7 +515,8 @@ public void testTableScan() ImmutableList.copyOf(assignments.keySet()), assignments, TupleDomain.none(), - false); + false, + Optional.empty()); effectivePredicate = effectivePredicateExtractor.extract(SESSION, node, TypeProvider.empty(), typeAnalyzer); assertEquals(effectivePredicate, FALSE_LITERAL); @@ -524,7 +527,8 @@ public void testTableScan() ImmutableList.copyOf(assignments.keySet()), assignments, predicate, - false); + false, + Optional.empty()); effectivePredicate = effectivePredicateExtractor.extract(SESSION, node, TypeProvider.empty(), typeAnalyzer); assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(bigintLiteral(1L), AE))); @@ -537,7 +541,8 @@ public void testTableScan() ImmutableList.copyOf(assignments.keySet()), assignments, predicate, - false); + false, + Optional.empty()); effectivePredicate = effectivePredicateExtractorWithoutTableProperties.extract(SESSION, node, TypeProvider.empty(), typeAnalyzer); assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(bigintLiteral(2L), BE), equals(bigintLiteral(1L), AE))); @@ -547,7 +552,8 @@ public void testTableScan() ImmutableList.copyOf(assignments.keySet()), assignments, TupleDomain.all(), - false); + false, + Optional.empty()); effectivePredicate = effectivePredicateExtractor.extract(SESSION, node, TypeProvider.empty(), typeAnalyzer); assertEquals(effectivePredicate, and(equals(AE, bigintLiteral(1)), equals(BE, bigintLiteral(2)))); @@ -559,7 +565,8 @@ public void testTableScan() TupleDomain.withColumnDomains(ImmutableMap.of( scanAssignments.get(A), Domain.multipleValues(BIGINT, ImmutableList.of(1L, 2L, 3L)), scanAssignments.get(B), Domain.multipleValues(BIGINT, ImmutableList.of(1L, 2L, 3L)))), - false); + false, + Optional.empty()); effectivePredicate = effectivePredicateExtractor.extract(SESSION, node, TypeProvider.empty(), typeAnalyzer); assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(bigintLiteral(2L), BE), equals(bigintLiteral(1L), AE))); @@ -569,7 +576,8 @@ public void testTableScan() ImmutableList.copyOf(assignments.keySet()), assignments, TupleDomain.all(), - false); + false, + Optional.empty()); effectivePredicate = effectivePredicateExtractor.extract(SESSION, node, TypeProvider.empty(), typeAnalyzer); assertEquals(effectivePredicate, BooleanLiteral.TRUE_LITERAL); } @@ -1137,7 +1145,8 @@ private static TableScanNode tableScanNode(Map scanAssignm ImmutableList.copyOf(scanAssignments.keySet()), scanAssignments, TupleDomain.all(), - false); + false, + Optional.empty()); } private static PlanNodeId newId() diff --git a/core/trino-main/src/test/java/io/trino/sql/planner/TestTypeValidator.java b/core/trino-main/src/test/java/io/trino/sql/planner/TestTypeValidator.java index 55d5a994d32d..d7ddf1303a98 100644 --- a/core/trino-main/src/test/java/io/trino/sql/planner/TestTypeValidator.java +++ b/core/trino-main/src/test/java/io/trino/sql/planner/TestTypeValidator.java @@ -102,7 +102,8 @@ public void setUp() ImmutableList.copyOf(assignments.keySet()), assignments, TupleDomain.all(), - false); + false, + Optional.empty()); } @Test diff --git a/core/trino-main/src/test/java/io/trino/sql/planner/iterative/rule/test/PlanBuilder.java b/core/trino-main/src/test/java/io/trino/sql/planner/iterative/rule/test/PlanBuilder.java index c383409078fd..d48f4a1ca1b3 100644 --- a/core/trino-main/src/test/java/io/trino/sql/planner/iterative/rule/test/PlanBuilder.java +++ b/core/trino-main/src/test/java/io/trino/sql/planner/iterative/rule/test/PlanBuilder.java @@ -498,7 +498,8 @@ public TableScanNode tableScan(List symbols, boolean forDelete) symbols, symbols.stream().collect(toImmutableMap(identity(), symbol -> new TestingMetadata.TestingColumnHandle(symbol.getName()))), TupleDomain.all(), - forDelete); + forDelete, + Optional.empty()); } public TableScanNode tableScan(List symbols, Map assignments) @@ -529,7 +530,8 @@ public TableScanNode tableScan( symbols, assignments, TupleDomain.all(), - forDelete); + forDelete, + Optional.empty()); } public TableScanNode tableScan( @@ -544,7 +546,8 @@ public TableScanNode tableScan( symbols, assignments, enforcedConstraint, - false); + false, + Optional.empty()); } public TableFinishNode tableDelete(SchemaTableName schemaTableName, PlanNode deleteSource, Symbol deleteRowId)