Github user ron8hu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17148#discussion_r104267295
  
    --- 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) =>
    +        if (cond.isInstanceOf[And] || cond.isInstanceOf[Or]) {
    +          // Don't support compound Not expression.
    --- End diff --
    
    I thought that we agreed not to support the nested NOT condition.  First we 
need to clarify what is nested NOT.  Here You allow ((NOT cond1) && (NOT 
cond2)).  But you disallow a condition NOT(cond1 && cond2).  Is this right?
    How about this case NOT( cond1 && (NOT cond2))?  The third case is a truly 
nested NOT 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