mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Merge pull request #46569 from ClickHouse/add-bug
Fix processing Const(LowCardinality) in arrayMap
This commit is contained in:
commit
36870f0801
@ -7,6 +7,7 @@
|
||||
#include <Columns/ColumnFunction.h>
|
||||
#include <Columns/ColumnMap.h>
|
||||
#include <Columns/ColumnNullable.h>
|
||||
#include <Columns/ColumnLowCardinality.h>
|
||||
#include <Columns/IColumn.h>
|
||||
|
||||
#include <Common/Exception.h>
|
||||
@ -393,9 +394,15 @@ public:
|
||||
replicated_column_function->appendArguments(arrays);
|
||||
|
||||
auto lambda_result = replicated_column_function->reduce();
|
||||
|
||||
/// Convert LowCardinality(T) -> T and Const(LowCardinality(T)) -> Const(T),
|
||||
/// because we removed LowCardinality from return type of lambda expression.
|
||||
if (lambda_result.column->lowCardinality())
|
||||
lambda_result.column = lambda_result.column->convertToFullColumnIfLowCardinality();
|
||||
|
||||
if (const auto * const_column = checkAndGetColumnConst<ColumnLowCardinality>(lambda_result.column.get()))
|
||||
lambda_result.column = const_column->removeLowCardinality();
|
||||
|
||||
if (Impl::needBoolean())
|
||||
{
|
||||
/// If result column is Nothing or Nullable(Nothing), just create const UInt8 column with 0 value.
|
||||
|
@ -0,0 +1 @@
|
||||
[2]
|
@ -0,0 +1 @@
|
||||
SELECT arrayMap(x -> (toLowCardinality(1) + 1::Nullable(UInt8)), [1]);
|
Loading…
Reference in New Issue
Block a user