Skip to content

Commit a591745

Browse files
committed
pass unit tests
1 parent f286c64 commit a591745

File tree

4 files changed

+199
-272
lines changed

4 files changed

+199
-272
lines changed

datafusion/core/tests/dataframe/mod.rs

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,10 +2529,9 @@ async fn test_count_wildcard_on_sort() -> Result<()> {
25292529
| | ProjectionExec: expr=[b@0 as b, count(Int64(1))@1 as count(*), count(Int64(1))@1 as count(Int64(1))] |
25302530
| | AggregateExec: mode=FinalPartitioned, gby=[b@0 as b], aggr=[count(Int64(1))] |
25312531
| | CoalesceBatchesExec: target_batch_size=8192 |
2532-
| | RepartitionExec: partitioning=Hash([b@0], 4), input_partitions=4 |
2533-
| | RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 |
2534-
| | AggregateExec: mode=Partial, gby=[b@0 as b], aggr=[count(Int64(1))] |
2535-
| | DataSourceExec: partitions=1, partition_sizes=[1] |
2532+
| | RepartitionExec: partitioning=Hash([b@0], 4), input_partitions=1 |
2533+
| | AggregateExec: mode=Partial, gby=[b@0 as b], aggr=[count(Int64(1))] |
2534+
| | DataSourceExec: partitions=1, partition_sizes=[1] |
25362535
| | |
25372536
+---------------+------------------------------------------------------------------------------------------------------------+
25382537
"###
@@ -2541,22 +2540,21 @@ async fn test_count_wildcard_on_sort() -> Result<()> {
25412540
assert_snapshot!(
25422541
pretty_format_batches(&df_results).unwrap(),
25432542
@r###"
2544-
+---------------+--------------------------------------------------------------------------------+
2545-
| plan_type | plan |
2546-
+---------------+--------------------------------------------------------------------------------+
2547-
| logical_plan | Sort: count(*) ASC NULLS LAST |
2548-
| | Aggregate: groupBy=[[t1.b]], aggr=[[count(Int64(1)) AS count(*)]] |
2549-
| | TableScan: t1 projection=[b] |
2550-
| physical_plan | SortPreservingMergeExec: [count(*)@1 ASC NULLS LAST] |
2551-
| | SortExec: expr=[count(*)@1 ASC NULLS LAST], preserve_partitioning=[true] |
2552-
| | AggregateExec: mode=FinalPartitioned, gby=[b@0 as b], aggr=[count(*)] |
2553-
| | CoalesceBatchesExec: target_batch_size=8192 |
2554-
| | RepartitionExec: partitioning=Hash([b@0], 4), input_partitions=4 |
2555-
| | RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 |
2556-
| | AggregateExec: mode=Partial, gby=[b@0 as b], aggr=[count(*)] |
2557-
| | DataSourceExec: partitions=1, partition_sizes=[1] |
2558-
| | |
2559-
+---------------+--------------------------------------------------------------------------------+
2543+
+---------------+----------------------------------------------------------------------------+
2544+
| plan_type | plan |
2545+
+---------------+----------------------------------------------------------------------------+
2546+
| logical_plan | Sort: count(*) ASC NULLS LAST |
2547+
| | Aggregate: groupBy=[[t1.b]], aggr=[[count(Int64(1)) AS count(*)]] |
2548+
| | TableScan: t1 projection=[b] |
2549+
| physical_plan | SortPreservingMergeExec: [count(*)@1 ASC NULLS LAST] |
2550+
| | SortExec: expr=[count(*)@1 ASC NULLS LAST], preserve_partitioning=[true] |
2551+
| | AggregateExec: mode=FinalPartitioned, gby=[b@0 as b], aggr=[count(*)] |
2552+
| | CoalesceBatchesExec: target_batch_size=8192 |
2553+
| | RepartitionExec: partitioning=Hash([b@0], 4), input_partitions=1 |
2554+
| | AggregateExec: mode=Partial, gby=[b@0 as b], aggr=[count(*)] |
2555+
| | DataSourceExec: partitions=1, partition_sizes=[1] |
2556+
| | |
2557+
+---------------+----------------------------------------------------------------------------+
25602558
"###
25612559
);
25622560
Ok(())
@@ -2872,10 +2870,9 @@ async fn test_count_wildcard_on_where_scalar_subquery() -> Result<()> {
28722870
| | ProjectionExec: expr=[count(Int64(1))@1 as count(*), a@0 as a, true as __always_true] |
28732871
| | AggregateExec: mode=FinalPartitioned, gby=[a@0 as a], aggr=[count(Int64(1))] |
28742872
| | CoalesceBatchesExec: target_batch_size=8192 |
2875-
| | RepartitionExec: partitioning=Hash([a@0], 4), input_partitions=4 |
2876-
| | RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 |
2877-
| | AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[count(Int64(1))] |
2878-
| | DataSourceExec: partitions=1, partition_sizes=[1] |
2873+
| | RepartitionExec: partitioning=Hash([a@0], 4), input_partitions=1 |
2874+
| | AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[count(Int64(1))] |
2875+
| | DataSourceExec: partitions=1, partition_sizes=[1] |
28792876
| | |
28802877
+---------------+---------------------------------------------------------------------------------------------------------------------------+
28812878
"
@@ -2929,10 +2926,9 @@ async fn test_count_wildcard_on_where_scalar_subquery() -> Result<()> {
29292926
| | ProjectionExec: expr=[count(*)@1 as count(*), a@0 as a, true as __always_true] |
29302927
| | AggregateExec: mode=FinalPartitioned, gby=[a@0 as a], aggr=[count(*)] |
29312928
| | CoalesceBatchesExec: target_batch_size=8192 |
2932-
| | RepartitionExec: partitioning=Hash([a@0], 4), input_partitions=4 |
2933-
| | RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 |
2934-
| | AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[count(*)] |
2935-
| | DataSourceExec: partitions=1, partition_sizes=[1] |
2929+
| | RepartitionExec: partitioning=Hash([a@0], 4), input_partitions=1 |
2930+
| | AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[count(*)] |
2931+
| | DataSourceExec: partitions=1, partition_sizes=[1] |
29362932
| | |
29372933
+---------------+---------------------------------------------------------------------------------------------------------------------------+
29382934
"

0 commit comments

Comments
 (0)