felixYyu edited a comment on issue #3558:
URL: https://github.com/apache/iceberg/issues/3558#issuecomment-1003286707
1.Spark Sql Alter Table:
```
ALTER TABLE table_identifier ADD [IF NOT EXISTS]
( partition_spec [ partition_spec ... ] )
Partition to be added. Note that one can use a typed literal (e.g.,
date’2019-01-02’) in the partition spec.
Syntax: PARTITION ( partition_col_name = partition_col_val [ , ... ] )
```
2.Iceberg SparkSqlExtensions Alter Table:
```
ALTER TABLE prod.db.sample ADD PARTITION FIELD bucket(16, id)
ALTER TABLE prod.db.sample ADD PARTITION FIELD truncate(data, 4)
```
3.Iceberg supports adding new partition fields to a spec, but spark sql
don't support adding **new partition field**, so I think iceberg [ALTER TABLE]
SQL extensions commands is better.
4.about [IF NOT EXISTS] and [IF EXISTS] commands, the method addField of
BaseUpdatePartitionSpec has already check,so the [IF NOT EXISTS] and [IF
EXISTS] commands are not necessary to add in the IcebergSqlExtensions.g4.
```
PartitionField existing = transformToField.get(validationKey);
Preconditions.checkArgument(existing == null,
"Cannot add duplicate partition field %s=%s, conflicts with %s",
name, term, existing);
```
--
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]