sigmod commented on code in PR #37697: URL: https://github.com/apache/spark/pull/37697#discussion_r960939857
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/BloomFilterAggregate.scala: ########## @@ -55,6 +55,13 @@ case class BloomFilterAggregate( Multiply(estimatedNumItemsExpression, Literal(8L))) } + def this(child: Expression, estimatedNumItems: Long) = { + this(child, Literal(estimatedNumItems), + Literal(math.min( + BloomFilter.optimalNumOfBits(estimatedNumItems, estimatedNumItems / 3000000000L.toDouble), + SQLConf.get.getConf(SQLConf.RUNTIME_BLOOM_FILTER_MAX_NUM_BITS)))) + } Review Comment: LGTM. Can we make sure that if estimatedNumItems >= RUNTIME_BLOOM_FILTER_MAX_NUM_ITEMS, it's always DEFAULT_FPP? Thanks, @wangyum ! -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org