jackye1995 commented on a change in pull request #2101:
URL: https://github.com/apache/iceberg/pull/2101#discussion_r560355573
##########
File path: site/docs/evolution.md
##########
@@ -62,3 +62,31 @@ When you evolve a partition spec, the old data written with
an earlier spec rema
Iceberg uses [hidden partitioning](./partitioning.md), so you don't *need* to
write queries for a specific partition layout to be fast. Instead, you can
write queries that select the data you need, and Iceberg automatically prunes
out files that don't contain matching data.
Partition evolution is a metadata operation and does not eagerly rewrite files.
+
+Iceberg's Java table API provides `updateSpec` API to update partition spec.
For example:
+
+```java
+sampleTable.updateSpec()
+ .addField(bucket("id", 8))
+ .renameField("category", "category")
+ .removeField("id_bucket_8", "shard")
+ .commit();
+```
Review comment:
Thanks for the comments, added explanations. For the second part, I
think it is already explained in docs before:
> When you evolve a partition spec, the old data written with an earlier
spec remains unchanged. New data is written using the new spec in a new layout.
Metadata for each of the partition versions is kept separately. Because of
this, when you start writing queries, you get split planning. This is where
each partition layout plans files separately using the filter it derives for
that specific partition layout.
----------------------------------------------------------------
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]