Fix CAST from LowCardinality(Nullable) to Dynamic

This commit is contained in:
avogar 2024-11-11 13:28:52 +00:00
parent ea806b05a0
commit 17f7097d5b
3 changed files with 10 additions and 1 deletions

View File

@ -4390,7 +4390,7 @@ private:
variant_column = IColumn::mutate(column);
/// Otherwise we should filter column.
else
variant_column = column->filter(filter, variant_size_hint)->assumeMutable();
variant_column = IColumn::mutate(column->filter(filter, variant_size_hint));
assert_cast<ColumnLowCardinality &>(*variant_column).nestedRemoveNullable();
return createVariantFromDescriptorsAndOneNonEmptyVariant(variant_types, std::move(discriminators), std::move(variant_column), variant_discr);

View File

@ -0,0 +1,7 @@
SET allow_suspicious_low_cardinality_types = 1, allow_experimental_dynamic_type = 1;
DROP TABLE IF EXISTS t0;
CREATE TABLE t0 (c0 LowCardinality(Nullable(Int))) ENGINE = Memory();
INSERT INTO TABLE t0 (c0) VALUES (NULL);
SELECT c0::Dynamic FROM t0;
SELECT c0 FROM t0;
DROP TABLE t0;