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

    https://github.com/apache/spark/pull/20624#discussion_r170567874
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/StarSchemaDetection.scala
 ---
    @@ -187,11 +187,11 @@ object StarSchemaDetection extends PredicateHelper {
               stats.rowCount match {
                 case Some(rowCount) if rowCount >= 0 =>
                   if (stats.attributeStats.nonEmpty && 
stats.attributeStats.contains(col)) {
    -                val colStats = stats.attributeStats.get(col)
    -                if (colStats.get.nullCount > 0) {
    +                val colStats = stats.attributeStats.get(col).get
    +                if (!colStats.hasCountStats || colStats.nullCount.get > 0) 
{
    --- End diff --
    
    `hasCountStats == distinctCount.isDefined && nullCount.isDefined`
    So if it passed to the second part of the ||, then `hasCountStats == true 
-> nullCount.isDefined`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to