-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Docs: Document compute_partition_stats procedure #13532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -974,6 +974,38 @@ Collect statistics of the snapshot with id `snap1` of table `my_table` for colum | |
| CALL catalog_name.system.compute_table_stats(table => 'my_table', snapshot_id => 'snap1', columns => array('col1', 'col2')); | ||
| ``` | ||
|
|
||
| ## Partition Statistics | ||
|
|
||
| ### `compute_partition_stats` | ||
|
|
||
| This procedure computes the stats incrementally from the last snapshot that has `PartitionStatisticsFile` until the given | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
By the way, can we link this text the spec about partition stats? (like the above command) |
||
| snapshot (uses current snapshot if not specified) and writes the combined result into a `PartitionStatisticsFile` | ||
| after merging the partition stats. It performs a full compute if previous statistics file does not exist. It also registers the | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should specify type of stats file, and also add article:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets get rid of 'merging the partition stats'? I feel its implied from 'incrementally' and 'combined'
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit (needs article and specify stats file): 'the previous partition statistics file' |
||
| `PartitionStatisticsFile` to table metadata. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: |
||
|
|
||
| | Argument Name | Required? | Type | Description | | ||
| |---------------|-----------|---------------|---------------------------------------------------------------------------------------| | ||
| | `table` | ✔️ | string | Name of the table | | ||
| | `snapshot_id` | | string | Id of the snapshot to collect partition stats. By default current snapshot id is used | | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'is used' sounds unnecessary. Hm how about just:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. collect => compute (follows the command name) |
||
|
|
||
| #### Output | ||
|
|
||
| | Output Name | Type | Description | | ||
| |-------------------|--------|-----------------------------------------------------------| | ||
| | `partition_statistics_file` | string | Path to partition stats file created from by this command | | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'to the partition stats file'. (add article) Also , 'from by', only need one. Use |
||
|
|
||
| #### Examples | ||
|
|
||
| Collect partition statistics of the latest snapshot of table `my_table` | ||
| ```sql | ||
| CALL catalog_name.system.compute_partition_stats('my_table'); | ||
| ``` | ||
|
|
||
| Collect partition statistics of the snapshot with id `snap1` of table `my_table` | ||
| ```sql | ||
| CALL catalog_name.system.compute_partition_stats(table => 'my_table', snapshot_id => 'snap1' ); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. small nit: extra space at end.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
| ``` | ||
|
|
||
| ## Table Replication | ||
|
|
||
| The `rewrite_table_path` procedure prepares an Iceberg table for copying to another location. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: a 'PartitionStatisticsFile' (need article for complete sentence)