You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/10/19 15:16:54 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #30443: [SPARK-33497][SQL] Override maxRows in some LogicalPlan

cloud-fan commented on a change in pull request #30443:
URL: https://github.com/apache/spark/pull/30443#discussion_r731979768



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
##########
@@ -326,6 +327,25 @@ case class Join(
     hint: JoinHint)
   extends BinaryNode with PredicateHelper {
 
+  override def maxRows: Option[Long] = {
+    joinType match {
+      case Inner | Cross | FullOuter | LeftOuter | RightOuter
+        if left.maxRows.isDefined && right.maxRows.isDefined =>
+        val maxRows = BigInt(left.maxRows.get) * BigInt(right.maxRows.get)

Review comment:
       This is wrong, if one side is empty, the join result is not always empty for outer join.
   
   It should be `product + sth`, `sth` = if (leftOuter) left.maxRows else if (rightOuter) right.maxRows else if (fullOuter) (left.maxRows + right.maxRows) 




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org