Merge pull request #62250 from ClickHouse/bad-boy-const

Correctly handle const columns in DistinctTransfom
This commit is contained in:
Antonio Andelic 2024-04-04 09:13:40 +02:00 committed by GitHub
commit 03feab3d20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 0 deletions

View File

@ -55,6 +55,7 @@ void DistinctTransform::transform(Chunk & chunk)
/// Convert to full column, because SetVariant for sparse column is not implemented.
convertToFullIfSparse(chunk);
convertToFullIfConst(chunk);
const auto num_rows = chunk.getNumRows();
auto columns = chunk.detachColumns();

View File

@ -0,0 +1 @@
SELECT DISTINCT COALESCE(COALESCE('') = toNullable('b3'), toUInt128(toNullable(2)), 2, 2, toLowCardinality(2), 2, 2, 2, toUInt128(toNullable(2)), materialize(2), toUInt128(2), 2, 2), COALESCE(COALESCE(COALESCE(materialize(''))) = 'b3', 2, 2, 2, toLowCardinality(2), toUInt128(2), 2, 2, 2, materialize(toUInt256(2)), 2, 2, 2) FROM numbers(100000);