Add Const column test cases for mapContains/Keys/Values

This commit is contained in:
hexiaoting 2021-01-23 22:53:08 +08:00
parent 143b84240e
commit 0f05b0ac9a
3 changed files with 6 additions and 2 deletions

View File

@ -177,6 +177,8 @@ public:
return std::make_shared<DataTypeUInt8>(); 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 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()); const ColumnMap * col_map = typeid_cast<const ColumnMap *>(arguments[0].column.get());

View File

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

View File

@ -23,4 +23,5 @@ drop table if exists table_map;
-- Const column -- Const column
select map( 'aa', 4, '44' , 5) as c, mapKeys(c), mapValues(c); 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');