Skip to content

Conversation

@Timzhang01
Copy link
Contributor

Enrich the description of the syntax of write distribution and ordering based on alter table.

@github-actions github-actions bot added the docs label Dec 30, 2021
@Timzhang01
Copy link
Contributor Author

In addition, I would like to know whether the partition field can be set by WRITE DISTRIBUTED BY, how we designed it

```
### `ALTER TABLE ... WRITE DISTRIBUTED BY PARTITION`

Iceberg tables can be configured with a hash distribution where tuples that share the same values for clustering expressions are
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requirement is to distribute by partition. Hash distribution is an implementation detail. Instead, I think this should state that WRITE DISTRIBUTED BY PARTITION will guarantee that a given partition is handled by one writer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okey

!!! Note
Table write order does not guarantee data order for queries. It only affects how data is written to the table.

Only local sorting can be set at the same time, use `LOCALLY ORDERED BY`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should first state that WRITE ORDERED BY sets a global ordering where rows are ordered across tasks, like using ORDER BY in an INSERT command. Then introduce LOCALLY ORDERED BY to order within each task but not across tasks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update

@Timzhang01 Timzhang01 requested a review from rdblue January 12, 2022 10:09
@rdblue
Copy link
Contributor

rdblue commented Jan 18, 2022

Thanks, @xiaotianzhang01!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants