Skip to content

Commit bed57df

Browse files
authored
[MINOR]: Move pipeline checker rule to the end (#10502)
* Move pipeline checker to last * Update slt
1 parent cb88a79 commit bed57df

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

datafusion/core/src/physical_optimizer/optimizer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ impl PhysicalOptimizer {
112112
// Remove the ancillary output requirement operator since we are done with the planning
113113
// phase.
114114
Arc::new(OutputRequirements::new_remove_mode()),
115-
// The PipelineChecker rule will reject non-runnable query plans that use
116-
// pipeline-breaking operators on infinite input(s). The rule generates a
117-
// diagnostic error message when this happens. It makes no changes to the
118-
// given query plan; i.e. it only acts as a final gatekeeping rule.
119-
Arc::new(PipelineChecker::new()),
120115
// The aggregation limiter will try to find situations where the accumulator count
121116
// is not tied to the cardinality, i.e. when the output of the aggregation is passed
122117
// into an `order by max(x) limit y`. In this case it will copy the limit value down
@@ -129,6 +124,11 @@ impl PhysicalOptimizer {
129124
// are not present, the load of executors such as join or union will be
130125
// reduced by narrowing their input tables.
131126
Arc::new(ProjectionPushdown::new()),
127+
// The PipelineChecker rule will reject non-runnable query plans that use
128+
// pipeline-breaking operators on infinite input(s). The rule generates a
129+
// diagnostic error message when this happens. It makes no changes to the
130+
// given query plan; i.e. it only acts as a final gatekeeping rule.
131+
Arc::new(PipelineChecker::new()),
132132
];
133133

134134
Self::with_rules(rules)

datafusion/sqllogictest/test_files/explain.slt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ physical_plan after OptimizeAggregateOrder SAME TEXT AS ABOVE
252252
physical_plan after ProjectionPushdown SAME TEXT AS ABOVE
253253
physical_plan after coalesce_batches SAME TEXT AS ABOVE
254254
physical_plan after OutputRequirements CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/example.csv]]}, projection=[a, b, c], has_header=true
255-
physical_plan after PipelineChecker SAME TEXT AS ABOVE
256255
physical_plan after LimitAggregation SAME TEXT AS ABOVE
257256
physical_plan after ProjectionPushdown SAME TEXT AS ABOVE
257+
physical_plan after PipelineChecker SAME TEXT AS ABOVE
258258
physical_plan CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/example.csv]]}, projection=[a, b, c], has_header=true
259259
physical_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]:)]]
260260

@@ -311,9 +311,9 @@ physical_plan after coalesce_batches SAME TEXT AS ABOVE
311311
physical_plan after OutputRequirements
312312
01)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]:)]]
313313
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]:)]]
314-
physical_plan after PipelineChecker SAME TEXT AS ABOVE
315314
physical_plan after LimitAggregation SAME TEXT AS ABOVE
316315
physical_plan after ProjectionPushdown SAME TEXT AS ABOVE
316+
physical_plan after PipelineChecker SAME TEXT AS ABOVE
317317
physical_plan
318318
01)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]:)]]
319319
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 ABOVE
348348
physical_plan after OutputRequirements
349349
01)GlobalLimitExec: skip=0, fetch=10
350350
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
351-
physical_plan after PipelineChecker SAME TEXT AS ABOVE
352351
physical_plan after LimitAggregation SAME TEXT AS ABOVE
353352
physical_plan after ProjectionPushdown SAME TEXT AS ABOVE
353+
physical_plan after PipelineChecker SAME TEXT AS ABOVE
354354
physical_plan
355355
01)GlobalLimitExec: skip=0, fetch=10
356356
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

0 commit comments

Comments
 (0)