Skip to content

Instantly share code, notes, and snippets.

@alrocar
Last active August 15, 2022 01:00
Show Gist options
  • Save alrocar/06cbc23511fbe56e099086a7cc9cb1e4 to your computer and use it in GitHub Desktop.
Save alrocar/06cbc23511fbe56e099086a7cc9cb1e4 to your computer and use it in GitHub Desktop.
Export from ClickHouse to Markdown table

SQL

SELECT
  number a,
  number + 1 b,
  number + 2 c
FROM numbers(100) INTO OUTFILE '/tmp/tt.md'
FORMAT Template
SETTINGS
  format_template_resultset = '/tmp/rows.format',
  format_template_row = '/tmp/row.format',
  format_template_rows_between_delimiter = '\n';

rows.format

|a|b|c|
|---|---|---|
${data}

row.format

|${a:CSV}|${b:CSV}|${c:CSV}|
@Gogiu23
Copy link

Gogiu23 commented Aug 15, 2022

Hey
How do you put a preview to yours jobs in GitHub? I search any info but I didn't find anything interesting.
Hope you can help me.
Best wishes.
👋🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment