xudong963 commented on code in PR #3674:
URL: https://github.com/apache/arrow-datafusion/pull/3674#discussion_r985088106


##########
datafusion/expr/src/logical_plan/builder.rs:
##########
@@ -781,6 +781,16 @@ impl LogicalPlanBuilder {
         join_type: JoinType,
         is_all: bool,
     ) -> Result<LogicalPlan> {
+        let left_len = left_plan.schema().fields().len();
+        let right_len = right_plan.schema().fields().len();
+
+        if left_len != right_len {
+            return Err(DataFusionError::Plan(format!(
+                "Expected the no. of fields to be the same. Left fields count 
= {} and right fields count = {} are not the same.",

Review Comment:
   ```suggestion
                   "each INTERSECT/EXCEPT query must have the same number of 
columns. Left fields count = {} and right fields count = {} are not the same.",
   ```



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

Reply via email to