mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #19515 from hexiaoting/map_functions_fix
Bug fix : support const column processing in mapContains, mapKeys, mapValues functions
This commit is contained in:
commit
f203a33a8f
@ -177,6 +177,8 @@ public:
|
||||
return std::make_shared<DataTypeUInt8>();
|
||||
}
|
||||
|
||||
bool useDefaultImplementationForConstants() const override { return true; }
|
||||
|
||||
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, size_t input_rows_count) const override
|
||||
{
|
||||
const ColumnMap * col_map = typeid_cast<const ColumnMap *>(arguments[0].column.get());
|
||||
@ -233,6 +235,8 @@ public:
|
||||
return std::make_shared<DataTypeArray>(key_type);
|
||||
}
|
||||
|
||||
bool useDefaultImplementationForConstants() const override { return true; }
|
||||
|
||||
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & /*result_type*/, size_t /*input_rows_count*/) const override
|
||||
{
|
||||
const ColumnMap * col_map = typeid_cast<const ColumnMap *>(arguments[0].column.get());
|
||||
@ -278,6 +282,8 @@ public:
|
||||
return std::make_shared<DataTypeArray>(value_type);
|
||||
}
|
||||
|
||||
bool useDefaultImplementationForConstants() const override { return true; }
|
||||
|
||||
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & /*result_type*/, size_t /*input_rows_count*/) const override
|
||||
{
|
||||
const ColumnMap * col_map = typeid_cast<const ColumnMap *>(arguments[0].column.get());
|
||||
|
@ -17,3 +17,5 @@
|
||||
[1000]
|
||||
[1001]
|
||||
[1002]
|
||||
{'aa':4,'bb':5} ['aa','bb'] [4,5]
|
||||
{'aa':4,'bb':5} 1 0
|
||||
|
@ -20,3 +20,8 @@ select mapContains(b, 'aaa') from table_map; -- { serverError 43 }
|
||||
select mapKeys(a) from table_map;
|
||||
select mapValues(a) from table_map;
|
||||
drop table if exists table_map;
|
||||
|
||||
|
||||
-- Const column
|
||||
select map( 'aa', 4, 'bb' , 5) as m, mapKeys(m), mapValues(m);
|
||||
select map( 'aa', 4, 'bb' , 5) as m, mapContains(m, 'aa'), mapContains(m, 'k');
|
||||
|
Loading…
Reference in New Issue
Block a user