polaris6 commented on a change in pull request #4463:
URL: https://github.com/apache/iceberg/pull/4463#discussion_r841054216
##########
File path: docs/spark/spark-writes.md
##########
@@ -328,14 +330,30 @@ PARTITIONED BY (days(ts), category)
To write data to the sample table, your data needs to be sorted by `days(ts),
category`.
-If you're inserting data with SQL statement, you can use `ORDER BY` to achieve
it, like below:
+If you're inserting data with SQL statement, you can use either `ORDER BY` to
trigger global sort, or `SORT BY` to trigger local sort. Global sort like below:
```sql
INSERT INTO prod.db.sample
SELECT id, data, category, ts FROM another_table
ORDER BY ts, category
```
+Local sort like below:
+
+```sql
+INSERT INTO prod.db.sample
+SELECT id, data, category, ts FROM another_table
+SORT BY ts, category
+```
+
+Of course, you can also use `SORT BY` with partition transforms.
+
+```sql
+INSERT INTO prod.db.sample
+SELECT id, data, category, ts FROM another_table
+SORT BY days(ts), category
Review comment:
I perfected the description, what do you think of this description?
--
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]