Skip to content

Commit a34bcf3

Browse files
committed
update snapshot: this appears to be the result of common_subexpr_eliminate rewriting. the plan looks correct.
1 parent d514acb commit a34bcf3

File tree

3 files changed

+22
-23
lines changed

3 files changed

+22
-23
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/core/tests/dataframe/mod.rs

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,28 +2570,26 @@ async fn test_count_wildcard_on_sort() -> Result<()> {
25702570

25712571
assert_snapshot!(
25722572
pretty_format_batches(&sql_results).unwrap(),
2573-
@r###"
2574-
+---------------+------------------------------------------------------------------------------------------------------------+
2575-
| plan_type | plan |
2576-
+---------------+------------------------------------------------------------------------------------------------------------+
2577-
| logical_plan | Projection: t1.b, count(*) |
2578-
| | Sort: count(Int64(1)) AS count(*) AS count(*) ASC NULLS LAST |
2579-
| | Projection: t1.b, count(Int64(1)) AS count(*), count(Int64(1)) |
2580-
| | Aggregate: groupBy=[[t1.b]], aggr=[[count(Int64(1))]] |
2581-
| | TableScan: t1 projection=[b] |
2582-
| physical_plan | ProjectionExec: expr=[b@0 as b, count(*)@1 as count(*)] |
2583-
| | SortPreservingMergeExec: [count(Int64(1))@2 ASC NULLS LAST] |
2584-
| | SortExec: expr=[count(Int64(1))@2 ASC NULLS LAST], preserve_partitioning=[true] |
2585-
| | ProjectionExec: expr=[b@0 as b, count(Int64(1))@1 as count(*), count(Int64(1))@1 as count(Int64(1))] |
2586-
| | AggregateExec: mode=FinalPartitioned, gby=[b@0 as b], aggr=[count(Int64(1))] |
2587-
| | CoalesceBatchesExec: target_batch_size=8192 |
2588-
| | RepartitionExec: partitioning=Hash([b@0], 4), input_partitions=4 |
2589-
| | RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 |
2590-
| | AggregateExec: mode=Partial, gby=[b@0 as b], aggr=[count(Int64(1))] |
2591-
| | DataSourceExec: partitions=1, partition_sizes=[1] |
2592-
| | |
2593-
+---------------+------------------------------------------------------------------------------------------------------------+
2594-
"###
2573+
@r"
2574+
+---------------+------------------------------------------------------------------------------------+
2575+
| plan_type | plan |
2576+
+---------------+------------------------------------------------------------------------------------+
2577+
| logical_plan | Sort: count(*) ASC NULLS LAST |
2578+
| | Projection: t1.b, count(Int64(1)) AS count(*) |
2579+
| | Aggregate: groupBy=[[t1.b]], aggr=[[count(Int64(1))]] |
2580+
| | TableScan: t1 projection=[b] |
2581+
| physical_plan | SortPreservingMergeExec: [count(*)@1 ASC NULLS LAST] |
2582+
| | SortExec: expr=[count(*)@1 ASC NULLS LAST], preserve_partitioning=[true] |
2583+
| | ProjectionExec: expr=[b@0 as b, count(Int64(1))@1 as count(*)] |
2584+
| | AggregateExec: mode=FinalPartitioned, gby=[b@0 as b], aggr=[count(Int64(1))] |
2585+
| | CoalesceBatchesExec: target_batch_size=8192 |
2586+
| | RepartitionExec: partitioning=Hash([b@0], 4), input_partitions=4 |
2587+
| | RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 |
2588+
| | AggregateExec: mode=Partial, gby=[b@0 as b], aggr=[count(Int64(1))] |
2589+
| | DataSourceExec: partitions=1, partition_sizes=[1] |
2590+
| | |
2591+
+---------------+------------------------------------------------------------------------------------+
2592+
"
25952593
);
25962594

25972595
assert_snapshot!(

datafusion/datasource/src/file_scan_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ impl FileScanConfig {
713713
match &self.projection {
714714
Some(proj) => proj.clone(),
715715
None => (0..self.file_schema.fields().len()
716-
+ self.metadata_cols.len())
716+
+ self.metadata_cols.len()
717717
+ self.table_partition_cols.len())
718718
.collect(),
719719
}

0 commit comments

Comments
 (0)