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

    https://github.com/apache/spark/pull/14034#discussion_r70194595
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/StatisticsSuite.scala ---
    @@ -31,4 +33,46 @@ class StatisticsSuite extends QueryTest with 
SharedSQLContext {
           spark.sessionState.conf.autoBroadcastJoinThreshold)
       }
     
    +  test("estimates the size of limit") {
    +    withTempTable("test") {
    +      Seq(("one", 1), ("two", 2), ("three", 3), ("four", 4)).toDF("k", "v")
    +        .createOrReplaceTempView("test")
    +      Seq((0, 1), (1, 24), (2, 48)).foreach { case (limit, expected) =>
    +        val df = sql(s"""SELECT * FROM test limit $limit""")
    +
    +        val sizesGlobalLimit = df.queryExecution.analyzed.collect { case 
g: GlobalLimit =>
    +          g.statistics.sizeInBytes
    +        }
    +        assert(sizesGlobalLimit.size === 1, s"Size wrong for:\n 
${df.queryExecution}")
    +        assert(sizesGlobalLimit.head === BigInt(expected),
    +          s"expected exact size 24 for table 'test', got: 
${sizesGlobalLimit.head}")
    --- End diff --
    
    : ) Forgot to change it. 


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