wuchong commented on a change in pull request #9277: 
[FLINK-13494][table-planner-blink] Only use env parallelism for sql job
URL: https://github.com/apache/flink/pull/9277#discussion_r309203459
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/exec/ExecNode.scala
 ##########
 @@ -94,4 +88,17 @@ trait ExecNode[E <: Planner, T] {
   def accept(visitor: ExecNodeVisitor): Unit = {
     visitor.visit(this)
   }
+
+  /**
+    *  Whether there is singleton exchange node as input.
+    */
+  protected def inputsContainSingleton(): Boolean = {
+    getInputNodes.foreach {
+      case exchange: Exchange
+        if exchange.getDistribution.getType == RelDistribution.Type.SINGLETON 
=>
+        return true
+      case _ => Unit
+    }
+    false
 
 Review comment:
   We can use `.exists` instead of return from foreach. 
   
   ```scala
   getInputNodes.exists {
         case exchange: Exchange
           if exchange.getDistribution.getType == 
RelDistribution.Type.SINGLETON => true
         case _ => false
       }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to