After having seen this I wrote up <a href="https://github.com/fzakaria/calcite-git" rel="nofollow">https://github.com/fzakaria/calcite-git</a> to demo doing this easily in Java using Apache Calcite
The same query, but but outputting an ASCII bar chart: <a href="https://bit.ly/3bcElz4" rel="nofollow">https://bit.ly/3bcElz4</a>
The same query is pretty interesting for the kubernetes source code too: <a href="https://bit.ly/3tDgbXd" rel="nofollow">https://bit.ly/3tDgbXd</a>