Stove-hust commented on a change in pull request #35363:
URL: https://github.com/apache/spark/pull/35363#discussion_r814457969
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala
##########
@@ -311,6 +311,16 @@ case class FilterEstimation(plan: Filter) extends Logging {
logDebug("[CBO] No statistics for " + attr)
return None
}
+
+ attr.dataType match {
+ case _: NumericType | DateType | TimestampType | BooleanType =>
+ if (!colStatsMap.hasMinMaxStats(attr)) {
Review comment:
> Do you mean this bug only happens in your Spark fork where you changed
the statistics collecting logic to not store min/max?
>
> also cc @wzhfy
I checked the community version of Spark's method for collecting statistics
and it looks like it is able to get min/max.
However, if the statistics are not collected with min/max, then the
community version of Spark will also get unexpected results, as described in
the test case I added.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]