MaxGekk opened a new pull request #30482:
URL: https://github.com/apache/spark/pull/30482


   ### What changes were proposed in this pull request?
   1. Extract the code for partition values casting from DSv1 to the common 
place `sql.util.PartitioningUtils` - the method `castPartitionValues()`.
   2. Re-use `castPartitionValues()` from DSv2 resolver of partition specs - 
`ResolvePartitionSpec`.
   
   ### Why are the changes needed?
   To have the same behavior as DSv1 which interprets 
`__HIVE_DEFAULT_PARTITION__` as `NULL`:
   ```sql
   spark-sql> CREATE TABLE tbl11 (id int, part0 string) USING parquet 
PARTITIONED BY (part0);
   spark-sql> ALTER TABLE tbl11 ADD PARTITION (part0 = 
'__HIVE_DEFAULT_PARTITION__');
   spark-sql> INSERT INTO tbl11 PARTITION (part0='__HIVE_DEFAULT_PARTITION__') 
SELECT 1;
   spark-sql> SELECT * FROM tbl11;
   1    NULL
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   Yes
   
   ### How was this patch tested?
   Add new test to `AlterTablePartitionV2SQLSuite`.


----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to