2010YOUY01 commented on code in PR #23184:
URL: https://github.com/apache/datafusion/pull/23184#discussion_r3557568495


##########
datafusion/sqllogictest/test_files/range_partitioning.slt:
##########
@@ -260,24 +260,393 @@ set datafusion.execution.target_partitions = 4;
 statement ok
 reset datafusion.optimizer.preserve_file_partitions;
 
+statement ok
+set datafusion.optimizer.prefer_hash_join = true;
+
+statement ok
+set datafusion.optimizer.repartition_joins = true;
+
+statement ok
+set datafusion.optimizer.preserve_file_partitions = 0;
+
 
 ##########
 # TEST 9: Join on Range Partition Column
-# Both inputs expose Range partitioning on range_key. Join planning currently
-# reaches the unsupported Range output-partitioning path; later optimizer PRs
-# can replace this baseline with a successful plan and result test.
+# A partitioned inner hash join requires co-partitioned KeyPartitioned inputs.
+# Compatible Range layouts satisfy both the per-child key requirements and the
+# cross-child layout requirement, so no Hash repartitioning is inserted.
 ##########
 
-query error This feature is not implemented: Join output partitioning with 
range partitioning is not implemented
+query TT
+EXPLAIN SELECT l.range_key, l.value, r.value
+FROM range_partitioned l
+JOIN range_partitioned r ON l.range_key = r.range_key;
+----
+physical_plan
+01)HashJoinExec: mode=Partitioned, join_type=Inner, on=[(range_key@0, 
range_key@0)], projection=[range_key@0, value@1, value@3]

Review Comment:
   nit and optional: since we're only checking if extra hash repartitioning is 
added for most `EXPLAIN` tests, we could do
   ```
   HashJoinExec: <slt:ignore>
   --DataSourceExec: <slt:ignore>
   --DataSourceExec: <slt:ignore>
   ```
   
   This way less future maintenance is needed, if unrelated explain plan 
changes break this test.



-- 
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