A pip package to run and schedule SQL queries on Starburst Galaxy or Enterprise clusters.
Project description
Starburst Scheduler
A Python CLI tool to run and schedule SQL queries on Starburst Galaxy or Starburst Enterprise clusters.
Installation
pip install starburst-scheduler
Requirements
- Starburst Galaxy or Enterprise cluster (e.g.,
free-cluster.trino.galaxy.starburst.io) - Valid Starburst username and password
- Python 3.9 or above
Usage
Run a One-Time Query
starburst-scheduler run-query \
--host free-cluster.trino.galaxy.starburst.io \
--user your-user@domain.com \
--password your-password \
--catalog tpch \
--schema tiny \
--query "SELECT 1"
Use Environment Variable (Secure)
# macOS/Linux
export STARBURST_PASSWORD=your-password
# Windows
set STARBURST_PASSWORD=your-password
starburst-scheduler run-query \
--host free-cluster.trino.galaxy.starburst.io \
--user your-user@domain.com \
--catalog tpch \
--schema tiny \
--query "SELECT 1"
Note: Default
--http-schemeishttps. Use--http-scheme httponly for local insecure clusters.
Schedule a Repeating Query
starburst-scheduler schedule-query \
--host free-cluster.trino.galaxy.starburst.io \
--user your-user@domain.com \
--password your-password \
--catalog tpch \
--schema tiny \
--query "SELECT * FROM nation" \
--frequency 60 \
--time-unit seconds
This runs the query every 60 seconds until manually stopped (Ctrl + C).
CLI Options
| Option | Description |
|---|---|
--host |
Starburst cluster host |
--user |
Starburst username or email |
--password |
Starburst password (or use env var) |
--catalog |
Catalog to query |
--schema |
Schema to query |
--query |
SQL query string |
--http-scheme |
https (default) or http for local use |
--frequency |
Frequency for scheduled query |
--time-unit |
Time unit (seconds, minutes, hours) |
Troubleshooting
Common Issues
-
Cluster Inactive Start it at: https://galaxy.starburst.io/home
-
401 Unauthorized
- Wrong credentials
- Quotes in environment variable
- Cluster not started
-
Connection Errors
- Wrong
--hostor--http-scheme
- Wrong
-
Access Denied
- User lacks permission on catalog/schema
-
Broken Installation
pip install --force-reinstall starburst-scheduler
License
MIT License
Contributing
Contributions are welcome. Submit issues or pull requests at: https://github.com/karranikhilreddy99/starburst_scheduler
Let me know if you want this delivered as a downloadable .md or .docx file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file starburst_scheduler-0.1.10.tar.gz.
File metadata
- Download URL: starburst_scheduler-0.1.10.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee8aa585cd2ebef0b4f3c7f1502245efa37151c22387085abd68eb3b21a82c46
|
|
| MD5 |
9ac19f5304b7c32c0b5dbbe2cad7414b
|
|
| BLAKE2b-256 |
3ef18b196126c9628f140f56f1390be68243f844bee90bf4d3e98263841cb9a4
|
File details
Details for the file starburst_scheduler-0.1.10-py3-none-any.whl.
File metadata
- Download URL: starburst_scheduler-0.1.10-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d9075ebe21fface6b3bfa45a2eeec91b087aa1171b3153f8c028acfc2ffa240
|
|
| MD5 |
3095898482070149c9ddea279c11a3d5
|
|
| BLAKE2b-256 |
052046deb4a1ee1d3f83032959fef4109fe910a015dd47b41fe8cd001b77d94c
|