wangyum opened a new pull request #30535:
URL: https://github.com/apache/spark/pull/30535


   ### What changes were proposed in this pull request?
   
   This pr make Hive Metastore support filter by string type with date values, 
a common case is:
   ```scala
   spark.sql("create table t1(id string) partitioned by (part string) stored as 
parquet")
   spark.sql("insert into t1 values('1', '2019-01-01')")
   spark.sql("insert into t1 values('2', '2019-01-02')")
   spark.sql("select * from t1 where  part = date '2019-01-01' ").show
   ```
   
   By 
[default](https://github.com/apache/spark/blob/6d31daeb6a2c5607ffe3b23ffb381626ad57f576/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala#L126-L129),
 we use `DateType` to compare `StringType` and `DateType`.
   
   
   ### Why are the changes needed?
   
   Improve query performance.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Unit test.


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



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

Reply via email to