diff --git a/datafusion/core/src/dataframe/mod.rs b/datafusion/core/src/dataframe/mod.rs index 1a7498162fae..5afa4e743872 100644 --- a/datafusion/core/src/dataframe/mod.rs +++ b/datafusion/core/src/dataframe/mod.rs @@ -2987,7 +2987,7 @@ mod tests { JoinType::Inner, Some(Expr::Literal(ScalarValue::Null)), )?; - let expected_plan = "Inner Join: \ + let expected_plan = "Cross Join: \ \n TableScan: a projection=[c1], full_filters=[Boolean(NULL)]\ \n TableScan: b projection=[c1]"; assert_eq!(expected_plan, format!("{}", join.into_optimized_plan()?)); diff --git a/datafusion/expr/src/logical_plan/builder.rs b/datafusion/expr/src/logical_plan/builder.rs index d67c24e5f5c6..6ab50440ec5b 100644 --- a/datafusion/expr/src/logical_plan/builder.rs +++ b/datafusion/expr/src/logical_plan/builder.rs @@ -949,13 +949,13 @@ impl LogicalPlanBuilder { /// Apply a cross join pub fn cross_join(self, right: LogicalPlan) -> Result { let join_schema = - build_join_schema(self.plan.schema(), right.schema(), &JoinType::Full)?; + build_join_schema(self.plan.schema(), right.schema(), &JoinType::Inner)?; Ok(Self::new(LogicalPlan::Join(Join { left: self.plan, right: Arc::new(right), on: vec![], filter: None, - join_type: JoinType::Full, + join_type: JoinType::Inner, join_constraint: JoinConstraint::On, null_equals_null: false, schema: DFSchemaRef::new(join_schema), diff --git a/datafusion/optimizer/src/push_down_filter.rs b/datafusion/optimizer/src/push_down_filter.rs index ab82dfd896cf..2e3bca5b0bbd 100644 --- a/datafusion/optimizer/src/push_down_filter.rs +++ b/datafusion/optimizer/src/push_down_filter.rs @@ -1727,7 +1727,7 @@ mod tests { .build()?; let expected = "Projection: test.a, test1.d\ - \n Inner Join: \ + \n Cross Join: \ \n Projection: test.a, test.b, test.c\ \n TableScan: test, full_filters=[test.a = Int32(1)]\ \n Projection: test1.d, test1.e, test1.f\ @@ -1754,7 +1754,7 @@ mod tests { .build()?; let expected = "Projection: test.a, test1.a\ - \n Inner Join: \ + \n Cross Join: \ \n Projection: test.a, test.b, test.c\ \n TableScan: test, full_filters=[test.a = Int32(1)]\ \n Projection: test1.a, test1.b, test1.c\