cloud-fan commented on a change in pull request #24685: [SPARK-27814][SQL] The 
cast operation for partition key may push down uncorrect filter, which  is 
fatal.
URL: https://github.com/apache/spark/pull/24685#discussion_r287676514
 
 

 ##########
 File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
 ##########
 @@ -2384,4 +2384,12 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils 
with TestHiveSingleton {
       }
     }
   }
+
+  test("SPARK-27814: test cast operation for partition key") {
+    withTable("t1") {
+      spark.sql("CREATE TABLE t1(c1 Int, c2 String) PARTITIONED BY (c3 Int)")
+      spark.sql("SELECT * FROM t1 WHERE CAST(c3 as String) = '0'").show()
 
 Review comment:
   let's not use `show` in test cases, use `checkAnswer`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to