LuciferYang commented on code in PR #60025:
URL: https://github.com/apache/spark/pull/60025#discussion_r4522722839


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/JoinEstimation.scala:
##########
@@ -201,7 +201,8 @@ case class JoinEstimation(join: Join) extends Logging {
       if (ValueInterval.isIntersected(lInterval, rInterval)) {
         val (newMin, newMax) = ValueInterval.intersect(lInterval, rInterval, 
leftKey.dataType)
         val (card, joinStat) = (leftKeyStat.histogram, rightKeyStat.histogram) 
match {
-          case (Some(l: Histogram), Some(r: Histogram)) =>
+          case (Some(l: Histogram), Some(r: Histogram))
+              if canEstimateWithHistogram(leftKey.dataType) =>

Review Comment:
   Following up on the TimestampNTZ point: I checked it on master, and with CBO 
on, a filter or join on an analyzed `TIMESTAMP_NTZ` column fails in 
`ValueInterval.apply` with `scala.MatchError: TimestampNTZType`. That is 
SPARK-57805, with an open PR #57526, so I'd rather have that land before moving 
the histogram handling to the entry points.
   



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

Reply via email to