You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/08/24 14:50:07 UTC

[GitHub] [iceberg] Fokko commented on a diff in pull request #5624: Docs: Added missing doc for REPLACE PARTITION FIELD

Fokko commented on code in PR #5624:
URL: https://github.com/apache/iceberg/pull/5624#discussion_r953901769


##########
docs/spark-ddl.md:
##########
@@ -365,6 +365,16 @@ For example, if you partition by days and move to partitioning by hours, overwri
 Be careful when dropping a partition field because it will change the schema of metadata tables, like `files`, and may cause metadata queries to fail or produce different results.
 {{< /hint >}}
 
+### `ALTER TABLE ... REPLACE PARTITION FIELD`
+
+A partition field can be replaced by a new partition field in a single metadata update by using `REPLACE PARTITION FIELD`:
+
+```sql
+ALTER TABLE prod.db.sample REPLACE PARTITION FIELD ts_day WITH days(timestamp)

Review Comment:
   ```suggestion
   ALTER TABLE prod.db.sample REPLACE PARTITION FIELD ts_day WITH days(ts)
   ```



##########
docs/spark-ddl.md:
##########
@@ -365,6 +365,16 @@ For example, if you partition by days and move to partitioning by hours, overwri
 Be careful when dropping a partition field because it will change the schema of metadata tables, like `files`, and may cause metadata queries to fail or produce different results.
 {{< /hint >}}
 
+### `ALTER TABLE ... REPLACE PARTITION FIELD`
+
+A partition field can be replaced by a new partition field in a single metadata update by using `REPLACE PARTITION FIELD`:
+
+```sql
+ALTER TABLE prod.db.sample REPLACE PARTITION FIELD ts_day WITH days(timestamp)
+-- use optional AS keyword to specify a custom name for the new partition field 
+ALTER TABLE prod.db.sample REPLACE PARTITION FIELD ts_day WITH days(timestamp) AS day_of_ts

Review Comment:
   ```suggestion
   ALTER TABLE prod.db.sample REPLACE PARTITION FIELD ts_day WITH days(ts) AS day_of_ts
   ```



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org