Difference between revisions of "Clickhouse-client"

From Initech Technical Wiki
Jump to: navigation, search
(Created page with "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 querie...")
 
 
Line 1: Line 1:
 
This is a collection of useful things i've learnt about clickhouse-client.
 
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.
+
* -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 - Use this to make clickhouse output in a different format.  Useful for outputing CSV or JSON to the terminal for adhock use elsewhere.
+
* -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.
 
** CSVWithNames - use this format to output CSV with a header row.
 
** JSONEachRow - this is a useful input and output format.
 
** JSONEachRow - this is a useful input and output format.
 
** A full list can be found here:  [https://clickhouse.yandex/docs/en/interfaces/formats/]
 
** A full list can be found here:  [https://clickhouse.yandex/docs/en/interfaces/formats/]

Latest revision as of 22:58, 18 October 2019

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]