WweiL commented on code in PR #38503:
URL: https://github.com/apache/spark/pull/38503#discussion_r1016829965


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/UnsupportedOperationChecker.scala:
##########
@@ -169,16 +179,24 @@ object UnsupportedOperationChecker extends Logging {
           "DataFrames/Datasets")(plan)
     }
 
-    // Disallow multiple streaming aggregations
-    val aggregates = collectStreamingAggregates(plan)
+    val statefulOps = plan.collect {
+      case p: LogicalPlan if isStatefulOperation(p) => p
+    }
 
-    if (aggregates.size > 1 && outputMode != InternalOutputModes.Append) {
+    if (statefulOps.size > 1 &&
+      outputMode != InternalOutputModes.Append &&
+      SQLConf.get.statefulOperatorCorrectnessCheckEnabled) {

Review Comment:
   Sure. IMHO it's still needed right now as we are still disabling 1) 
stream-stream time join as you mentioned above 2) multiple stateful ops when 
output mode is not append. 3) MapGroupWithState before aggregation. 
   
   For 3). There are few checks added [as in this 
comment](https://github.com/apache/spark/pull/38503#discussion_r1016174482). 
Specifically, when `statefulOperatorCorrectnessCheckEnabled` is true, 
`MapGroupWithState->agg` is disallowed, when it is false, 
`MapGroupWithState->agg` is allowed to execute.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to