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 2022/09/03 05:18:08 UTC

[GitHub] [spark] wangyum commented on a diff in pull request #37532: [SPARK-39989][SQL][FollowUp] Improve foldable expression stats estimate for string and binary

wangyum commented on code in PR #37532:
URL: https://github.com/apache/spark/pull/37532#discussion_r962105864


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/EstimationUtils.scala:
##########
@@ -128,6 +149,25 @@ object EstimationUtils {
     if (outputRowCount > 0) outputRowCount * getSizePerRow(attributes, attrStats) else 1
   }
 
+  /**
+   * Get the size in bytes of a value of a constant expression
+   * @param expr
+   * @return the size in bytes
+   */
+  def getConstantLen(expr: Expression): Long = {

Review Comment:
   Use "value"? Otherwise the expression needs to be evaluated twice.



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