Clickhouse-client

From Initech Technical Wiki
Jump to: navigation, search

This is a collection of useful things i've learnt about clickhouse-client.

  • -m: Use this to make clickhouse act more like mysql so that it will accept multi-line queries an expect a ; at the end to execute the query.
  • -f <format>: Use this to make clickhouse output in a different format. Useful for outputing CSV or JSON to the terminal for adhock use elsewhere.
    • CSVWithNames - use this format to output CSV with a header row.
    • JSONEachRow - this is a useful input and output format.
    • A full list can be found here: [1]