Skip to content

Conversation

@zhangxffff
Copy link
Contributor

Which issue does this PR close?

Closes #8204 .
SubTask of #6195 .

@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Nov 23, 2023
statement ok
CREATE TABLE t1000 (i BIGINT) AS
WITH t AS (VALUES (0), (0), (0), (0), (0), (0), (0), (0), (0), (0))
SELECT ROW_NUMBER() OVER (PARTITION BY t1.column1) FROM t t1, t t2, t t3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I double checked that this actually generates partitioned input and it does indeed.

You can see on my local setup that the MemoryExec has multiple partitions

❯ explain select distinct i  from t1000;
+---------------+-----------------------------------------------------------------------------------------------------+
| plan_type     | plan                                                                                                |
+---------------+-----------------------------------------------------------------------------------------------------+
| logical_plan  | Aggregate: groupBy=[[t1000.i]], aggr=[[]]                                                           |
|               |   TableScan: t1000 projection=[i]                                                                   |
| physical_plan | AggregateExec: mode=FinalPartitioned, gby=[i@0 as i], aggr=[]                                       |
|               |   CoalesceBatchesExec: target_batch_size=8192                                                       |
|               |     RepartitionExec: partitioning=Hash([i@0], 16), input_partitions=16                              |
|               |       AggregateExec: mode=Partial, gby=[i@0 as i], aggr=[]                                          |
|               |         MemoryExec: partitions=16, partition_sizes=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1] |
|               |                                                                                                     |
+---------------+-----------------------------------------------------------------------------------------------------+

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty of updating some comments / adding an explain tests in 26510c9

@alamb
Copy link
Contributor

alamb commented Nov 28, 2023

Since I had it checked out anyways, I fixed the clippy issues in f5015ad and pushed to this branch

@alamb
Copy link
Contributor

alamb commented Nov 28, 2023

Thank you very much @zhangxffff -- this is a great initial contribution. I really appreciate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port tests in limit.rs to sqllogictest

2 participants