databricks-sql-cli icon indicating copy to clipboard operation
databricks-sql-cli copied to clipboard

Feature Request: json should be an output format option

Open alexiswl opened this issue 2 years ago • 0 comments

Hello,

I may wish to return this as a json format where each row is a record.

Note this is a current workaround for returning a query in json format

jq --raw-output <<< "$( \
  dbsqlcli \
    --execute \
    '
      SELECT * FROM TABLE
    ' | \
  python -c "import pandas as pd; import sys; print(pd.read_csv(sys.stdin).to_json(orient='records'))" \
)"

alexiswl avatar Jun 14 '23 10:06 alexiswl