kramerul commented on code in PR #3191:
URL: https://github.com/apache/calcite/pull/3191#discussion_r1189364524


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -4021,19 +4021,30 @@ private void validateModality(SqlNode query) {
       default:
         break;
       }
+    } else if (query.getKind() == SqlKind.WITH) {
+      SqlWith with = (SqlWith) query;
+      for (SqlNode item : with.withList) {
+        SqlNode operand = ((SqlWithItem) item).query;
+        validateModality(operand, modality);
+      }
+      validateModality(with.body, modality);
     } else {
       assert query.isA(SqlKind.SET_QUERY);
       final SqlCall call = (SqlCall) query;
       for (SqlNode operand : call.getOperandList()) {
-        if (deduceModality(operand) != modality) {
-          throw newValidationError(operand,
-              Static.RESOURCE.streamSetOpInconsistentInputs());
-        }
-        validateModality(operand);
+        validateModality(operand, modality);
       }
     }
   }
 
+  private  void validateModality(SqlNode operand, SqlModality modality) {

Review Comment:
   Done



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