jackye1995 commented on a change in pull request #2101:
URL: https://github.com/apache/iceberg/pull/2101#discussion_r560357281



##########
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();
+```
+
+Spark supports updating partition spec through its `ALTER TABLE` SQL 
statement, see more details in [Spark 
SQL](../spark/#alter-table-add-partition-field).
+
+## Sort order evolution
+
+Similar to partition spec, Iceberg sort order can also be updated in an 
existing table.
+When you evolve a sort order, the old data written with an earlier order 
remains unchanged.
+Engines can always choose to write data in the latest sort order or unsorted 
when sorting is prohibitively expensive.

Review comment:
       It won't return incorrect data, the default sort order ID is always 0, 
which means unsorted.




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

Reply via email to