Skip to content

fix(actions): use type-appropriate Column Profiler query for Array/Map/Tuple columns - #71

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/60-column-profiler-complex-types
Sep 29, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/60-column-profiler-complex-types

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • column.stats in src/sdui/actions.rs always emitted min()/max()/topK(5)() on the raw column, and column.top_10 always emitted a plain GROUP BY on it. ClickHouse rejects both for Array/Map/Tuple columns: min/max/topK abort with ILLEGAL_TYPE_OF_ARGUMENT, and Map additionally isn't groupable/hashable for GROUP BY.
  • get_context_actions_for_node now takes an optional column_type (the ClickHouse type string). handle_context_actions looks it up from system.columns before generating actions (skipped for mock/test connections, where it stays None).
  • For Array/Map/Tuple (including Nullable(...)-wrapped) columns, column.stats is rebuilt around min(length(...))/max(length(...)) instead of min/max/topK, and column.top_10 is omitted entirely, since exact-value grouping on a collection column isn't meaningful and would still fail for Map.
  • Scalar columns (including when the type is unknown/None) keep the exact original query, unchanged.

Closes #60

Test plan

  • cargo test — 95/95 passing, including new regression tests for both the pure get_context_actions_for_node function (Array/Map/Tuple/Nullable-wrapped types) and the handle_context_actions mock-connection path
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings

…p/Tuple columns. Closes #60

column.stats always ran min()/max()/topK() on the raw column and
column.top_10 always ran a plain GROUP BY on it, both of which ClickHouse
rejects for Array/Map/Tuple columns (ILLEGAL_TYPE_OF_ARGUMENT on
min/max/topK, and Map isn't groupable/hashable for GROUP BY).

get_context_actions_for_node now takes the column's ClickHouse type
(looked up from system.columns in handle_context_actions, skipped for
mock/test connections) and, for Array/Map/Tuple columns, builds
column.stats around min(length())/max(length()) instead of min()/max()/
topK(), and omits column.top_10 entirely since exact-value grouping on
a collection column isn't meaningful. Scalar columns keep the original
query unchanged.
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit f84a3cf into dev Sep 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant