ygf11 commented on code in PR #4602:
URL: https://github.com/apache/arrow-datafusion/pull/4602#discussion_r1051376311
##########
datafusion/core/tests/sql/joins.rs:
##########
@@ -2448,3 +2492,289 @@ async fn reduce_cross_join_with_wildcard_and_expr() ->
Result<()> {
Ok(())
}
+
+#[tokio::test]
+async fn both_side_expr_key_inner_join() -> Result<()> {
+ let test_repartition_joins = vec![true, false];
+ for repartition_joins in test_repartition_joins {
+ let ctx = create_join_context("t1_id", "t2_id", repartition_joins)?;
+
+ let sql = "SELECT t1.t1_id, t2.t2_id, t1.t1_name \
+ FROM t1 \
+ INNER JOIN t2 \
+ ON t1.t1_id + cast(12 as INT UNSIGNED) = t2.t2_id +
cast(1 as INT UNSIGNED)";
+
+ let msg = format!("Creating logical plan for '{}'", sql);
+ let plan = ctx.create_logical_plan(sql).expect(&msg);
+ let state = ctx.state();
+ let logical_plan = state.optimize(&plan)?;
+ let physical_plan = state.create_physical_plan(&logical_plan).await?;
+
+ let expected = if repartition_joins {
+ vec![
+ "ProjectionExec: expr=[t1_id@0 as t1_id, t2_id@2 as t2_id,
t1_name@1 as t1_name]",
+ " ProjectionExec: expr=[t1_id@0 as t1_id, t1_name@1 as
t1_name, t2_id@3 as t2_id]",
Review Comment:
I will work on it.
--
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]