0

Query

SELECT column_name, data_type
FROM `bigquery-public-data.samples.INFORMATION_SCHEMA.COLUMNS` 
WHERE table_name = 'shakespeare'

When I from command line output looks formatted

+-------------+-----------+
| column_name | data_type |
+-------------+-----------+
| word        | STRING    |
| word_count  | INT64     |
| corpus      | STRING    |
| corpus_date | INT64     |
+-------------+-----------+

When I run from java, get a json response. Is there any way to print command line look a like output using java code?

1 Answer 1

1

No, not without doing some parsing/formatting yourself. What you are seeing in this example is the BigQuery CLI tool formatting the JSON response from the API (it will always return JSON) using Python under the hood. You'd need to do the same in your Java application. There might be libs that do this already, so have a look around.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.