Skip to content

Commit

Permalink
Clarify docs for ALTER TABLE EXECUTE
Browse files Browse the repository at this point in the history
  • Loading branch information
sheajamba authored and mosabua committed Mar 31, 2024
1 parent c511c91 commit 89232e5
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions docs/src/main/sphinx/sql/alter-table.md
Expand Up @@ -54,13 +54,18 @@ per-connector basis.
You can use the `=>` operator for passing named parameter values.
The left side is the name of the parameter, the right side is the value being passed.

Collapse files in a table that are over 128 megabytes in size with the `optimize`
procedure from the [Hive](hive-alter-table-execute), [Delta
Lake](delta-lake-alter-table-execute) , and
[Iceberg](iceberg-alter-table-execute) connectors:

```
ALTER TABLE hive.schema.test_table EXECUTE optimize(file_size_threshold => '128MB')
Executable commands are contributed by connectors, such as the `optimize`
command provided by the [Hive](hive-alter-table-execute), [Delta
Lake](delta-lake-alter-table-execute), and
[Iceberg](iceberg-alter-table-execute) connectors. For example, a user observing
many small files in the storage of a table called `test_table` in the `test`
schema of the `example` catalog, can use the `optimize` command to merge all
files below the `file_size_threshold` value. The result is fewer, but larger
files, which typically results in higher query performance on the data in the
files:

```
ALTER TABLE example.test.test_table EXECUTE optimize(file_size_threshold => '16MB')
```

## Examples
Expand Down

0 comments on commit 89232e5

Please sign in to comment.