CuteChuanChuan commented on code in PR #27529:
URL: https://github.com/apache/datafusion/pull/27529#discussion_r4614819800


##########
datafusion/sqllogictest/test_files/repartition.slt:
##########
@@ -139,3 +139,74 @@ statement ok
 DROP TABLE t1;
 
 # End repartition on empty columns test
+
+# Start reorder aggregate keys with duplicate group column names test.
+# See https://github.com/apache/datafusion/issues/27221
+
+# Force partitioned hash joins so the join reorders the aggregate's keys
+statement ok
+set datafusion.optimizer.hash_join_single_partition_threshold = 0;
+
+statement ok
+set datafusion.optimizer.hash_join_single_partition_threshold_rows = 0;
+
+statement ok
+CREATE TABLE t1 (a INT) AS VALUES (1), (2), (3);
+
+statement ok
+CREATE TABLE t2 (a INT) AS VALUES (10), (20), (30);
+
+statement ok
+CREATE TABLE t3 (a INT) AS VALUES (100), (200), (300);
+
+statement ok
+CREATE TABLE t4 (k1 INT, k2 INT, k3 INT, v VARCHAR) AS VALUES
+  (1, 20, 300, 'x'),
+  (2, 30, 100, 'y'),
+  (3, 10, 200, 'z');
+
+# Two keys swapped

Review Comment:
   Thanks! Added in 01962ff. Agreed it's worth guarding against the join no 
longer being partitioned.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to