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

    https://github.com/apache/spark/pull/7674#discussion_r35491410
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala 
---
    @@ -825,11 +813,43 @@ class DataFrameSuite extends QueryTest with 
SQLTestUtils {
           assert(e2.getMessage.contains("Inserting into an RDD-based table is 
not allowed."))
     
           // error case: insert into an OneRowRelation
    -      new DataFrame(ctx, OneRowRelation).registerTempTable("one_row")
    +      new DataFrame(sqlContext, 
OneRowRelation).registerTempTable("one_row")
           val e3 = intercept[AnalysisException] {
             insertion.write.insertInto("one_row")
           }
           assert(e3.getMessage.contains("Inserting into an RDD-based table is 
not allowed."))
         }
       }
    +
    +  test("SPARK-8608: call `show` on local DataFrame with random columns 
should return same value") {
    +    // Make sure we can pass this test for both codegen mode and 
interpreted mode.
    +    withSQLConf(SQLConf.CODEGEN_ENABLED.key -> "true") {
    +      val df = testData.select(rand(33))
    +      assert(df.showString(5) == df.showString(5))
    +    }
    +
    +    withSQLConf(SQLConf.CODEGEN_ENABLED.key -> "false") {
    +      val df = testData.select(rand(33))
    +      assert(df.showString(5) == df.showString(5))
    +    }
    +
    +    // We will reuse the same Expression object for LocalRelation.
    +    val df = (1 to 10).map(Tuple1.apply).toDF().select(rand(33))
    +    assert(df.showString(5) == df.showString(5))
    +  }
    +
    +  test("SPARK-8609: local DataFrame with random columns should return same 
value after sort") {
    --- End diff --
    
    This case should be fixed by https://github.com/apache/spark/pull/7593. 
However, `PullOutNondeterministic` rule can also handle it, so we can add this 
test before #7593 .


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