Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17148#discussion_r104228432
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala
 ---
    @@ -101,21 +101,23 @@ case class FilterEstimation(plan: Filter, 
catalystConf: CatalystConf) extends Lo
             }
     
           case Or(cond1, cond2) =>
    -        // For ease of debugging, we compute percent1 and percent2 in 2 
statements.
             val percent1 = calculateFilterSelectivity(cond1, update = false)
             val percent2 = calculateFilterSelectivity(cond2, update = false)
             (percent1, percent2) match {
               case (Some(p1), Some(p2)) => Some(math.min(1.0, p1 + p2 - (p1 * 
p2)))
    -          case (Some(p1), None) => Some(1.0)
    -          case (None, Some(p2)) => Some(1.0)
    -          case (None, None) => None
    +          case _ => None
             }
     
    -      case Not(cond) => calculateFilterSelectivity(cond, update = false) 
match {
    -        case Some(percent) => Some(1.0 - percent)
    -        // for not-supported condition, set filter selectivity to a 
conservative estimate 100%
    -        case None => None
    -      }
    +      case Not(cond) =>
    --- End diff --
    
    add some comment to explain this case


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to