AntiO2 opened a new pull request, #16711:
URL: https://github.com/apache/iceberg/pull/16711

   ## Summary
   
   Adds Spark 4.1 SQL DDL support for Iceberg column default values.
   
   Supported syntax:
   
   - `CREATE TABLE ... DEFAULT ...`
   - `ALTER TABLE ... ADD COLUMN ... DEFAULT ...`
   - `ALTER TABLE ... ALTER COLUMN ... SET DEFAULT ...`
   - `ALTER TABLE ... ALTER COLUMN ... DROP DEFAULT`
   
   The implementation uses Spark's typed default value APIs and converts Spark 
literal defaults to Iceberg literals.
   
   ## Scope
   
   This PR is limited to Spark 4.1.
   
   Complex type default value creation is not supported for now. Defaults for 
`ARRAY`, `MAP`, and `STRUCT` are rejected with a clear error message in both 
`CREATE TABLE` and `ALTER TABLE ADD COLUMN` paths.
   
   Supported primitive Spark SQL types are covered by tests, including boolean, 
numeric, decimal, string, date, timestamp, timestamp_ntz, and binary.
   
   Closes #16698 
   
   ## Validation
   
   ```bash
   ./gradlew --no-daemon --max-workers=2 \
     :iceberg-spark:iceberg-spark-4.1_2.13:test \
     --tests org.apache.iceberg.spark.sql.TestSparkDefaultValues \
     --tests 
org.apache.iceberg.spark.sql.TestAlterTable.testAddColumnWithDefaultValue \
     -x spotlessCheck
   ```
   
   ```bash
   ./gradlew --no-daemon --max-workers=2 \
     :iceberg-spark:iceberg-spark-4.1_2.13:spotlessCheck
   ```
   
   ## Notes
   
   AI assistance was used to draft and iterate on the implementation and tests. 
The implementation, scope, and validation were manually reviewed.
   


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

To unsubscribe, e-mail: [email protected]

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