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

    https://github.com/apache/spark/pull/18960#discussion_r133625043
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/QueryPartitionSuite.scala ---
    @@ -68,4 +68,25 @@ class QueryPartitionSuite extends QueryTest with 
SQLTestUtils with TestHiveSingl
           sql("DROP TABLE IF EXISTS createAndInsertTest")
         }
       }
    +
    +  test("SPARK-21739: Cast expression should initialize timezoneId " +
    +    "when it is called statically to convert something into 
TimestampType") {
    +    // create table for test
    +    sql("CREATE TABLE table_with_timestamp_partition(value int) 
PARTITIONED by (ts timestamp)")
    +    sql("INSERT OVERWRITE TABLE table_with_timestamp_partition " +
    +      "partition (ts = '2010-01-01 00:00:00.000') VALUES (1)")
    +    sql("INSERT OVERWRITE TABLE table_with_timestamp_partition " +
    +      "partition (ts = '2010-01-02 00:00:00.000') VALUES (2)")
    +
    +    // test for Cast expression in TableReader
    +    checkAnswer(sql("select value from table_with_timestamp_partition"),
    +      Seq(Row(1), Row(2)))
    +
    +    // test for Cast expression in HiveTableScanExec
    +    checkAnswer(sql("select value from table_with_timestamp_partition " +
    +      "where ts = '2010-01-02 00:00:00.000'"), Row(2))
    +
    +    sql("DROP TABLE IF EXISTS table_with_timestamp_partition")
    --- End diff --
    
    use `WithTable`. You can check how we do it in the other test cases


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