Apache DataFusion SQL Query Engine
[MINOR]: Move pipeline checker rule to the end (#10502)
Mustafa Akurbed57df3e8dc
diff --git a/datafusion/core/src/physical_optimizer/optimizer.rs b/datafusion/core/src/physical_optimizer/optimizer.rsindex 08cbf68fa6..416985983d 100644--- a/datafusion/core/src/physical_optimizer/optimizer.rs+++ b/datafusion/core/src/physical_optimizer/optimizer.rs@@ -112,11 +112,6 @@ impl PhysicalOptimizer {// Remove the ancillary output requirement operator since we are done with the planning// phase.Arc::new(OutputRequirements::new_remove_mode()),- // The PipelineChecker rule will reject non-runnable query plans that use- // pipeline-breaking operators on infinite input(s). The rule generates a- // diagnostic error message when this happens. It makes no changes to the- // given query plan; i.e. it only acts as a final gatekeeping rule.- Arc::new(PipelineChecker::new()),// The aggregation limiter will try to find situations where the accumulator count// is not tied to the cardinality, i.e. when the output of the aggregation is passed// into an `order by max(x) limit y`. In this case it will copy the limit value down@@ -129,6 +124,11 @@ impl PhysicalOptimizer {// are not present, the load of executors such as join or union will be// reduced by narrowing their input tables.Arc::new(ProjectionPushdown::new()),+ // The PipelineChecker rule will reject non-runnable query plans that use+ // pipeline-breaking operators on infinite input(s). The rule generates a+ // diagnostic error message when this happens. It makes no changes to the+ // given query plan; i.e. it only acts as a final gatekeeping rule.+ Arc::new(PipelineChecker::new()),];Self::with_rules(rules)diff --git a/datafusion/sqllogictest/test_files/explain.slt b/datafusion/sqllogictest/test_files/explain.sltindex 3a4ac747eb..92c537f975 100644--- a/datafusion/sqllogictest/test_files/explain.slt+++ b/datafusion/sqllogictest/test_files/explain.slt@@ -252,9 +252,9 @@ physical_plan after OptimizeAggregateOrder SAME TEXT AS ABOVEphysical_plan after ProjectionPushdown SAME TEXT AS ABOVEphysical_plan after coalesce_batches SAME TEXT AS ABOVEphysical_plan after OutputRequirements CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/example.csv]]}, projection=[a, b, c], has_header=true-physical_plan after PipelineChecker SAME TEXT AS ABOVEphysical_plan after LimitAggregation SAME TEXT AS ABOVEphysical_plan after ProjectionPushdown SAME TEXT AS ABOVE+physical_plan after PipelineChecker SAME TEXT AS ABOVEphysical_plan CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/example.csv]]}, projection=[a, b, c], has_header=truephysical_plan_with_stats CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/example.csv]]}, projection=[a, b, c], has_header=true, statistics=[Rows=Absent, Bytes=Absent, [(Col[0]:),(Col[1]:),(Col[2]:)]]@@ -311,9 +311,9 @@ physical_plan after coalesce_batches SAME TEXT AS ABOVEphysical_plan after OutputRequirements01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(8), Bytes=Absent, [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]]02)--ParquetExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, statistics=[Rows=Exact(8), Bytes=Absent, [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]]-physical_plan after PipelineChecker SAME TEXT AS ABOVEphysical_plan after LimitAggregation SAME TEXT AS ABOVEphysical_plan after ProjectionPushdown SAME TEXT AS ABOVE+physical_plan after PipelineChecker SAME TEXT AS ABOVEphysical_plan01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(8), Bytes=Absent, [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]]02)--ParquetExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, statistics=[Rows=Exact(8), Bytes=Absent, [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]]@@ -348,9 +348,9 @@ physical_plan after coalesce_batches SAME TEXT AS ABOVEphysical_plan after OutputRequirements01)GlobalLimitExec: skip=0, fetch=1002)--ParquetExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10-physical_plan after PipelineChecker SAME TEXT AS ABOVEphysical_plan after LimitAggregation SAME TEXT AS ABOVEphysical_plan after ProjectionPushdown SAME TEXT AS ABOVE+physical_plan after PipelineChecker SAME TEXT AS ABOVEphysical_plan01)GlobalLimitExec: skip=0, fetch=1002)--ParquetExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10