zhengruifeng commented on a change in pull request #19393:
URL: https://github.com/apache/spark/pull/19393#discussion_r628724926



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
##########
@@ -200,6 +203,17 @@ case class Union(children: Seq[LogicalPlan]) extends 
LogicalPlan {
     }
   }
 
+  /**
+   * Note the definition has assumption about how union is implemented 
physically.
+   */
+  override def maxRowsPerPartition: Option[Long] = {
+    if (children.exists(_.maxRowsPerPartition.isEmpty)) {
+      None
+    } else {
+      Some(children.flatMap(_.maxRowsPerPartition).sum)

Review comment:
       I guess here should be 
`Some(children.flatMap(_.maxRowsPerPartition).max)`?




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



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

Reply via email to