jonathanc-n commented on code in PR #17651:
URL: https://github.com/apache/datafusion/pull/17651#discussion_r2389407895
##########
datafusion/core/tests/physical_optimizer/join_selection.rs:
##########
@@ -369,6 +369,61 @@ async fn test_join_with_swap_semi() {
}
}
+#[tokio::test]
+async fn test_join_with_swap_mark() {
+ let join_types = [JoinType::LeftMark];
+ for join_type in join_types {
+ let (big, small) = create_big_and_small();
+
+ let join = HashJoinExec::try_new(
+ Arc::clone(&big),
+ Arc::clone(&small),
+ vec![(
+ Arc::new(Column::new_with_schema("big_col",
&big.schema()).unwrap()),
+ Arc::new(Column::new_with_schema("small_col",
&small.schema()).unwrap()),
+ )],
+ None,
+ &join_type,
+ None,
+ PartitionMode::Partitioned,
+ NullEquality::NullEqualsNothing,
+ )
+ .unwrap();
+
+ let original_schema = join.schema();
+
+ let optimized_join = JoinSelection::new()
+ .optimize(Arc::new(join), &ConfigOptions::new())
+ .unwrap();
+
+ let swapped_join = optimized_join
+ .as_any()
+ .downcast_ref::<HashJoinExec>()
+ .expect(
+ "A proj is not required to swap columns back to their original
order",
+ );
+
+ assert_eq!(swapped_join.schema().fields().len(), 2);
+ assert_eq!(
+ swapped_join
+ .left()
+ .partition_statistics(None)
+ .unwrap()
+ .total_byte_size,
+ Precision::Inexact(8192)
+ );
+ assert_eq!(
+ swapped_join
+ .right()
+ .partition_statistics(None)
+ .unwrap()
+ .total_byte_size,
+ Precision::Inexact(2097152)
Review Comment:
I don't think so, i have copied this from the other previous join selection
swapping testing and thos ehave been working fine.
--
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]