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

    https://github.com/apache/spark/pull/17415#discussion_r109476460
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/statsEstimation/FilterEstimationSuite.scala
 ---
    @@ -491,7 +599,22 @@ class FilterEstimationSuite extends 
StatsEstimationTestBase {
             sizeInBytes = getOutputSize(filter.output, expectedRowCount, 
expectedAttributeMap),
             rowCount = Some(expectedRowCount),
             attributeStats = expectedAttributeMap)
    -      assert(filter.stats(conf) == expectedStats)
    +
    +      val filterStats = filter.stats(conf)
    +      assert(filterStats.sizeInBytes == expectedStats.sizeInBytes)
    +      assert(filterStats.rowCount == expectedStats.rowCount)
    +      val rowCountValue = filterStats.rowCount.getOrElse(0)
    +      // check the output column stats if the row count is > 0.
    +      // When row count is 0, the output is set to empty.
    +      if (rowCountValue != 0) {
    +        // Need to check attributeStats one by one because we may have 
multiple output columns.
    +        // Due to update operation, the output columns may be in different 
order.
    +        expectedColStats.foreach { kv =>
    +          val filterColumnStat = filterStats.attributeStats.get(kv._1).get
    --- End diff --
    
    Good point.  fixed.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to