mirror of https://github.com/ByConity/ByConity
Fixed LEFT ARRAY JOIN for constant arrays [#CLICKHOUSE-2946].
This commit is contained in:
parent
be316af758
commit
3de78d093b
|
@ -372,7 +372,10 @@ void ExpressionAction::execute(Block & block) const
|
|||
}
|
||||
|
||||
any_array_ptr = non_empty_array_columns.begin()->second;
|
||||
any_array = typeid_cast<const ColumnArray *>(&*any_array_ptr);
|
||||
if (auto converted = any_array_ptr->convertToFullColumnIfConst())
|
||||
any_array_ptr = converted;
|
||||
|
||||
any_array = &typeid_cast<const ColumnArray &>(*any_array_ptr);
|
||||
}
|
||||
|
||||
size_t columns = block.columns();
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[1] 1
|
||||
[] 0
|
||||
[] 0
|
||||
[1] 1
|
||||
[2,3] 2
|
||||
[2,3] 3
|
|
@ -0,0 +1,3 @@
|
|||
SELECT arr, element FROM (SELECT [1] AS arr) LEFT ARRAY JOIN arr AS element;
|
||||
SELECT arr, element FROM (SELECT emptyArrayUInt8() AS arr) LEFT ARRAY JOIN arr AS element;
|
||||
SELECT arr, element FROM (SELECT arrayJoin([emptyArrayUInt8(), [1], [2, 3]]) AS arr) LEFT ARRAY JOIN arr AS element;
|
Loading…
Reference in New Issue