yyanyy commented on a change in pull request #2101:
URL: https://github.com/apache/iceberg/pull/2101#discussion_r560620148
##########
File path: site/docs/spark.md
##########
@@ -258,6 +258,47 @@ ALTER TABLE prod.db.sample DROP COLUMN id
ALTER TABLE prod.db.sample DROP COLUMN point.z
```
+### `ALTER TABLE ... ADD PARTITION FIELD`
+
+```sql
+ALTER TABLE prod.db.sample ADD PARTITION FIELD catalog -- identity transform
+ALTER TABLE prod.db.sample ADD PARTITION FIELD bucket(16, id)
+ALTER TABLE prod.db.sample ADD PARTITION FIELD truncate(data, 4)
+ALTER TABLE prod.db.sample ADD PARTITION FIELD years(ts)
+-- use optional AS keyword to specify a custom name for the partition field
+ALTER TABLE prod.db.sample ADD PARTITION FIELD bucket(16, id) AS shard
+```
+
+!!! Warning
+ Changing partitioning will change the behavior of dynamic writes, which
overwrite any partition that is written to.
Review comment:
Based on my understanding: "dynamic writes" -> "`INSERT OVERWRITE` with
dynamic overwrites"? Also "that is written to" is a bit hard to understand, but
I couldn't come up with a good suggestion on this...
##########
File path: site/docs/spark.md
##########
@@ -24,7 +24,7 @@ Iceberg uses Apache Spark's DataSourceV2 API for data source
and catalog impleme
| [SQL create table](#create-table) | ✔️ | |
|
| [SQL create table as](#create-table-as-select) | ✔️ | |
|
| [SQL replace table as](#replace-table-as-select) | ✔️ | |
|
-| [SQL alter table](#alter-table) | ✔️ | |
|
+| [SQL alter table](#alter-table) | ✔️ | |
⚠ Updating partition field or sort order requires extensions enabled |
Review comment:
Nit: either "extensions-enabled" or "extensions to be enabled"? Took me
some time to parse this sentence correctly...
----------------------------------------------------------------
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]