Installation
pip install in your Databricks Notebook
%pip install auto_zorder
Example Usage
Note: If the cluster log delivery has not been active for very long then you may not see any results.
Basic Usage
optimize_cmd = auto_zorder(
cluster_ids=['cluster_id_1', 'cluster_id_2'],
optimize_table='my_db.my_table'
)
print(optimize_cmd)
>>> 'OPTIMIZE my_db.my_table ZORDER BY (col1, col2, col3, col4, col5)'
# To run the OPTIMIZE Command
spark.sql(optimize_cmd)
Limit the Number of ZORDER columns
optimize_cmd = auto_zorder(
cluster_ids=['cluster_id_1', 'cluster_id_2'],
optimize_table='my_db.my_table',
number_of_cols=2
)
print(optimize_cmd)
>>> 'OPTIMIZE my_db.my_table ZORDER BY (col1, col2)'
Save auto zorder analysis
optimize_cmd = auto_zorder(
cluster_ids=['cluster_id_1'],
optimize_table='my_db.my_table',
save_analysis='my_db.my_analysis'
)
Run auto zorder using analysis instead of cluster logs
optimize_cmd = auto_zorder(
use_analysis='my_db.my_analysis',
optimize_table='my_db.my_table'
)
Include additional columns and location in ZORDER
optimize_cmd = auto_zorder(
cluster_ids=['cluster_id_1', 'cluster_id_2'],
optimize_table='my_db.my_table',
use_add_cols=[('add_col1', 0), ('add_col2', 4)]
)
print(optimize_cmd)
>>> 'OPTIMIZE my_db.my_table ZORDER BY (add_col1, auto_col1, auto_col2, auto_col3, add_col2, auto_col4, auto_col5)'
Release files for auto-zorder 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| auto_zorder-0.1.1.tar.gz | 5.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| auto_zorder-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.5 kB
Release files / auto_zorder-0.1.1.tar.gz
| Download URL | auto_zorder-0.1.1.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13698054b2e6997f5c3cb7ac8e15c303ad4a8cba9cff5a1545151860c1f900ae
|
|
BLAKE2b-256 checksum How to use checksums |
5c3ad96eeffa8e3c798d9d9c609282b081db44b6e09a07a52bcc573efe9e3486
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.8
|
Release files / auto_zorder-0.1.1-py3-none-any.whl
| Download URL | auto_zorder-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dbc0e5f126edc302adceeb1ebc2ad9c384ed0ed52ac4229b94c1d1cb5c8e971f
|
|
BLAKE2b-256 checksum How to use checksums |
2ed570c40108a19f87a29f8edb163019c3aa545901ab9663ad5ec5e6e188860a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.8
|