Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variant Type GROUP BY NOT_IMPLEMENTED Error #59996

Closed
BooBSD opened this issue Feb 14, 2024 · 0 comments · Fixed by #60198
Closed

Variant Type GROUP BY NOT_IMPLEMENTED Error #59996

BooBSD opened this issue Feb 14, 2024 · 0 comments · Fixed by #60198
Assignees

Comments

@BooBSD
Copy link
Contributor

BooBSD commented Feb 14, 2024

Describe the unexpected behaviour

It looks like GROUP BY doesn't work over Variant type.

How to reproduce

ClickHouse client version 24.2.1.628 (official build).
Connecting to database staging at example.com:9000 as user admin.
Connected to ClickHouse server version 24.1.2.
SET allow_experimental_variant_type = 1;

CREATE table test_variant
(
    event_name  LowCardinality(String)  CODEC(ZSTD),
    event_value Variant(String, UInt64) CODEC(ZSTD),
    created_at  DateTime64(3, 'UTC')    CODEC(DoubleDelta, ZSTD)
)
ENGINE = ReplacingMergeTree()
PARTITION BY toYYYYMM(created_at)
ORDER BY (event_name, created_at);

INSERT INTO test_variant VALUES ('test', NULL, now()), ('test', 'Test1', now() + 1), ('test', 42, now() + 2), ('test', 'Test2', now() + 3);

And final query:

SELECT
    event_name,
    argMax(event_value, created_at) AS last_value,
    max(created_at) AS last
FROM test_variant
FINAL
GROUP BY event_name

Query id: 7171774d-d76b-47f7-b121-b4d2b5782355


Elapsed: 0.131 sec. 

Received exception from server (version 24.1.2):
Code: 48. DB::Exception: Received from example.com:9000. DB::Exception: Cannot insert field Test2 to column Variant(String, UInt64): While executing ConvertingAggregatedToChunksTransform. (NOT_IMPLEMENTED)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants