Add const column test case for mapKeys and mapValues

This commit is contained in:
hexiaoting 2021-01-23 22:48:14 +08:00
parent 6a78b10e0b
commit 143b84240e
3 changed files with 9 additions and 0 deletions

View File

@ -233,6 +233,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 +280,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());

View File

@ -17,3 +17,4 @@
[1000]
[1001]
[1002]
{'aa':4,'44':5} ['aa','44'] [4,5]

View File

@ -20,3 +20,7 @@ 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, '44' , 5) as c, mapKeys(c), mapValues(c);