You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why does PrettyCompact creates a new "table" for the aggregated/DISTINCT data if it isn't properly ordered? I'm not sure how to phrase this correctly, but here's an example:
:) SELECT DISTINCT toDate(created_at) FROM test FORMAT PrettyCompact;
┌─toDate(created_at)┐
│ 2016-09-05 │
│ 2016-09-03 │
│ 2016-09-04 │
└───────────────────┘
┌─toDate(created_at)┐
│ 2016-09-01 │
│ 2016-09-02 │
└───────────────────┘
:) SELECT DISTINCT toDate(created_at) FROM test ORDER BY created_at FORMAT PrettyCompact;
┌─toDate(created_at)┐
│ 2016-09-01 │
│ 2016-09-02 │
│ 2016-09-03 │
│ 2016-09-04 │
│ 2016-09-05 │
└───────────────────┘
:) SELECT DISTINCT toDate(created_at) FROM test FORMAT PrettyCompactMonoBlock;
┌─toDate(created_at)┐
│ 2016-09-05 │
│ 2016-09-03 │
│ 2016-09-04 │
│ 2016-09-01 │
│ 2016-09-02 │
└───────────────────┘
Wouldn't it be better to make PrettyCompactMonoBlock the default formatter for the CLI?
If not, what are the use-cases of PrettyCompact behaving like that (with multiple tables displayed) being useful?
And by the way - is GitHub issues appropriate to ask these kind of questions or should I ask it on StackOverflow/Google Groups instead?
In Pretty formats, to render a table, we need to know maximum widths of columns.
To calculate them, we must buffer data for that table.
But we don't want to buffer all data, for two reasons:
We don't want to consume too much memory.
(Really not a reason because there is limit for 10 000 rows in Pretty formats)
We want to output data as soon as it is received.
Data is received in blocks. As soon as each block is received, we render it.
When query is "streaming" it will send result block by block.
Several workarounds possible.
We may not render each small block instantly, but wait for some timeout, and render it only if next block has not arrived within that timeout. I think, this is unnecessarily complex solution.
By the way, it is possible to set default format in configuration file of clickhouse-client.
Configuration file is searched in:
Activity
alexey-milovidov commentedon Sep 26, 2016
In Pretty formats, to render a table, we need to know maximum widths of columns.
To calculate them, we must buffer data for that table.
But we don't want to buffer all data, for two reasons:
(Really not a reason because there is limit for 10 000 rows in Pretty formats)
Data is received in blocks. As soon as each block is received, we render it.
When query is "streaming" it will send result block by block.
Several workarounds possible.
We may not render each small block instantly, but wait for some timeout, and render it only if next block has not arrived within that timeout. I think, this is unnecessarily complex solution.
By the way, it is possible to set default format in configuration file of clickhouse-client.
Configuration file is searched in:
Create it with following content:
GitHub is appropriate. Stackoverflow is too.
Maybe Google Groups are better (there is already more questions), but I am not sure.
DOCS-620: Background pools settings (#11358)
Support loading setting from config file and improve logging. (ClickH…
Merge master, point contrib/llvm-project at the merged ClickHouse/llv…