minor: Ballista showplan helper script#1761
Conversation
showplan hepler script
showplan hepler scriptshowplan helper script
| STAGES_URL="${API_BASE}api/job/${JOB_ID}/stages" | ||
| fi | ||
|
|
||
| COLS=$(tput cols 2>/dev/tty || echo 80) |
There was a problem hiding this comment.
| COLS=$(tput cols 2>/dev/tty || echo 80) | |
| COLS=$(tput cols 2>/dev/null || echo 80) |
There was a problem hiding this comment.
this does not work, it will return 80 every time
There was a problem hiding this comment.
$ COLS=$(tput cols 2>/dev/null || echo 80)
$ echo $COLS
238You want errors to be ignored, right ?
The normal way is to write them to /dev/null. It will return 80 only if /dev/null is not existing or your OS user does not have permissions to read that file.
$ ls -la /dev/null
crw-rw-rw- 1 root root 1, 3 May 12 14:08 /dev/null
$ COLS=$(tput cols 2>/dev/null || echo 80) && echo $COLS
238
$ COLS=$(tput cols 2>/dev/nulllll || echo 80) && echo $COLS
bash: /dev/nulllll: Permission denied
80There was a problem hiding this comment.
Yes, but for some reason it return 80 all the time on my own machine
There was a problem hiding this comment.
$ COLS=$(tput cols 2>/dev/null || echo 80)
$ echo $COLS
80
$ tput cols
215
for some reason
There was a problem hiding this comment.
minor thing we can fix it later if needed
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
| STAGES_URL="${API_BASE}api/job/${JOB_ID}/stages" | ||
| fi | ||
|
|
||
| COLS=$(tput cols 2>/dev/tty || echo 80) |
There was a problem hiding this comment.
$ COLS=$(tput cols 2>/dev/null || echo 80)
$ echo $COLS
238You want errors to be ignored, right ?
The normal way is to write them to /dev/null. It will return 80 only if /dev/null is not existing or your OS user does not have permissions to read that file.
$ ls -la /dev/null
crw-rw-rw- 1 root root 1, 3 May 12 14:08 /dev/null
$ COLS=$(tput cols 2>/dev/null || echo 80) && echo $COLS
238
$ COLS=$(tput cols 2>/dev/nulllll || echo 80) && echo $COLS
bash: /dev/nulllll: Permission denied
80Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
|
Ballista plan print CLI helper
What
Adds
dev/bin/showplan.sh, a bash CLI utility for quickly inspecting query plans of Ballista jobs directly from the terminal, using the Ballista REST API.Why
Inspecting a job's logical, physical, or stage plans currently requires manually assembling
curl+jqpipelines and knowing which endpoint to hit. This script wraps that into a single ergonomic command, making debugging and plan analysis faster during development.ballista-clidisplays this information but copying and pasting the generated plan is difficult. Furthermore, inspecting the last job plans during development is common and offers a quick way to access this information.How it works
The script queries the Ballista scheduler REST API (default:
http://localhost:50050/) and prints the requested plan for a given job.Usage:
Options:
job_idmax_by(.start_time)from/api/jobs)-a ADDRhttp://localhost:50050/)-pphysical_planfrom job info (default)-llogical_planfrom job info-estage_plan(execution plan) from job info-s [STAGE_ID]/api/job/{id}/stages)-wless -S(no line-wrap, horizontal scroll — useful for wide plans)-t?render_tree=truequery parameter)Other details:
tput cols, falls back to 80)set -euo pipefailfor safe error handling