Open universalmind303 opened 10 months ago
Additionally, it'd be nice to do something like polars. They have the env var POLARS_FMT_STR_LEN
which allows you to manually set the max str length to use.
It seems to sample from the front instead of evenly.
for example, i'd expect this to render a table of the same character width
\rows 1000 select exclude(parameters) from glare_catalog.functions order by function_name asc; select exclude(parameters) from glare_catalog.functions order by function_name desc;
However, when descending order, it truncates APPROX_PERCENTILE_CONT_WITH_WEIGHT and APPROX_PERCENTILE_CONT.
We do only sample from the beginning. We can extend that to sample evenly in the first record batch but we want to avoid buffering all batches in memory. This might be enough to get a more representative width.
ugly table
Yeah I agree the long string table looks pretty bad.
Description
The width detection logic still seems to be a bit off.
It seems to sample from the front instead of evenly.
for example, i'd expect this to render a table of the same character width
However, when descending order, it truncates
APPROX_PERCENTILE_CONT_WITH_WEIGHT
andAPPROX_PERCENTILE_CONT
.Setting
\max-width
has no effect.Additionally, on fields with very long strings and newlines, it produces nearly illegible tables.
It seems to work fine when there is 1 column though