mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Cast to enum nullable fix
This commit is contained in:
parent
afa24938bc
commit
75f5679bf0
@ -2774,12 +2774,16 @@ private:
|
||||
auto & out_data = static_cast<typename EnumType::ColumnType &>(*res).getData();
|
||||
out_data.resize(size);
|
||||
|
||||
auto default_enum_value = result_type.getValues().front().second;
|
||||
|
||||
if (nullable_col)
|
||||
{
|
||||
for (const auto i : ext::range(0, size))
|
||||
{
|
||||
if (!nullable_col->isNullAt(i))
|
||||
out_data[i] = result_type.getValue(col->getDataAt(i));
|
||||
else
|
||||
out_data[i] = default_enum_value;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -0,0 +1 @@
|
||||
SELECT toUInt8(assumeNotNull(cast(cast(NULL, 'Nullable(String)'), 'Nullable(Enum8(\'Hello\' = 1))')));
|
Loading…
Reference in New Issue
Block a user