snuyanzin commented on code in PR #4389:
URL: https://github.com/apache/calcite/pull/4389#discussion_r2097252698


##########
core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java:
##########
@@ -5238,6 +5238,35 @@ private ImmutableList<ImmutableBitSet> 
cube(ImmutableBitSet... sets) {
         .fails("Type mismatch in column 1 of UNION");
 
     sql("select ^slacker^ from emp union select name from dept").ok();
+
+    sql("select ^name^ from dept union select name from dept union select 
slacker from emp")
+        .withTypeCoercion(false)
+        .fails("Type mismatch in column 1 of UNION");
+
+    sql("select ^name^ from dept except select name from dept except select 
slacker from emp")
+        .withTypeCoercion(false)
+        .fails("Type mismatch in column 1 of EXCEPT");
+
+    sql("select ^name^ from dept intersect select name from dept intersect 
select slacker from emp")

Review Comment:
   Can you elaborate here please what you mean?
   
   The initial issue was that the query like 
   ```sql
   select name from dept union select name from dept union select slacker from 
emp
   ```
   failed with 
   ```
   Caused by: java.lang.UnsupportedOperationException: class 
org.apache.calcite.sql.SqlBasicCall: SELECT `NAME`
   FROM `DEPT`
   UNION
   SELECT `NAME`
   FROM `DEPT`
   ```
   
   after the fix it fails with more explainable error
   like 
   ```
   Type mismatch in column 1 of UNION
   ```
   
   I can update jira with this info if it makes sense



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