diff --git a/src/Functions/map.cpp b/src/Functions/map.cpp index 84cd0f7ede7..83fc822aa11 100644 --- a/src/Functions/map.cpp +++ b/src/Functions/map.cpp @@ -177,6 +177,8 @@ public: return std::make_shared(); } + 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(arguments[0].column.get()); diff --git a/tests/queries/0_stateless/01651_map_functions.reference b/tests/queries/0_stateless/01651_map_functions.reference index 0689144977c..cbbadbb5162 100644 --- a/tests/queries/0_stateless/01651_map_functions.reference +++ b/tests/queries/0_stateless/01651_map_functions.reference @@ -17,4 +17,5 @@ [1000] [1001] [1002] -{'aa':4,'44':5} ['aa','44'] [4,5] +{'aa':4,'bb':5} ['aa','bb'] [4,5] +{'aa':4,'bb':5} 1 0 diff --git a/tests/queries/0_stateless/01651_map_functions.sql b/tests/queries/0_stateless/01651_map_functions.sql index dfc08851e5c..062547ea620 100644 --- a/tests/queries/0_stateless/01651_map_functions.sql +++ b/tests/queries/0_stateless/01651_map_functions.sql @@ -23,4 +23,5 @@ drop table if exists table_map; -- 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');