diff --git a/src/Functions/getSubcolumn.cpp b/src/Functions/getSubcolumn.cpp index f041165385e..a284963fa71 100644 --- a/src/Functions/getSubcolumn.cpp +++ b/src/Functions/getSubcolumn.cpp @@ -23,6 +23,7 @@ public: size_t getNumberOfArguments() const override { return 2; } bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo &) const override { return true; } bool useDefaultImplementationForConstants() const override { return true; } + bool useDefaultImplementationForLowCardinalityColumns() const override { return false; } ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {1}; } DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override diff --git a/tests/queries/0_stateless/02731_analyzer_join_resolve_nested.reference b/tests/queries/0_stateless/02731_analyzer_join_resolve_nested.reference index 5f1b7e8b1fe..e72893e9638 100644 --- a/tests/queries/0_stateless/02731_analyzer_join_resolve_nested.reference +++ b/tests/queries/0_stateless/02731_analyzer_join_resolve_nested.reference @@ -140,14 +140,14 @@ [[[([(1,'d')],'d')]]] Array(Array(Nested(t Nested(t Int32, s String), s String))) [[[[1]]]] Array(Array(Array(Array(Int32)))) [[[([(1,'d')],'d')]]] [['s']] Array(Array(Array(Tuple(Array(Tuple(Int64, String)), String)))) Array(Array(String)) -[[[[(1,'d')]]]] [[['d']]] Array(Array(Array(Array(Tuple(\n t Int32,\n s String))))) Array(Array(Array(String))) +[[[[(1,'d')]]]] [[['d']]] Array(Array(Array(Nested(t Int32, s String)))) Array(Array(Array(String))) [[[[1]]]] [[[['d']]]] Array(Array(Array(Array(Int32)))) Array(Array(Array(Array(String)))) [([([([(1,'d')],'d')],'s')],'s')] Array(Tuple(\n t Array(Tuple(\n t Array(Tuple(\n t Array(Tuple(\n t Int32,\n s String)),\n s String)),\n s String)),\n s String)) [[([([(1,'d')],'d')],'s')]] Array(Nested(t Nested(t Nested(t Int32, s String), s String), s String)) [[[([(1,'d')],'d')]]] Array(Array(Array(Tuple(Array(Tuple(Int64, String)), String)))) [[[[1]]]] Array(Array(Array(Array(Int32)))) [[([([(1,'d')],'d')],'s')]] ['s'] Array(Array(Tuple(\n t Array(Tuple(\n t Array(Tuple(\n t Int32,\n s String)),\n s String)),\n s String))) Array(String) -[[[([(1,'d')],'d')]]] [['s']] Array(Array(Array(Tuple(\n t Array(Tuple(\n t Int32,\n s String)),\n s String)))) Array(Array(String)) +[[[([(1,'d')],'d')]]] [['s']] Array(Array(Nested(t Nested(t Int32, s String), s String))) Array(Array(String)) [[[[(1,'d')]]]] [[['d']]] Array(Array(Array(Array(Tuple(Int64, String))))) Array(Array(Array(String))) [[[[1]]]] [[[['d']]]] Array(Array(Array(Array(Int32)))) Array(Array(Array(Array(String)))) [([([([(1,'d')],'d')],'s')],'s')] Array(Tuple(\n t Array(Tuple(\n t Array(Tuple(\n t Array(Tuple(\n t Int32,\n s String)),\n s String)),\n s String)),\n s String)) @@ -297,14 +297,14 @@ [[[([(1,'d')],'d')]]] Array(Array(Nested(t Nested(t Int32, s String), s String))) [[[[1]]]] Array(Array(Array(Array(Int32)))) [[[([(1,'d')],'d')]]] [['s']] Array(Array(Array(Tuple(Array(Tuple(Int64, String)), String)))) Array(Array(String)) -[[[[(1,'d')]]]] [[['d']]] Array(Array(Array(Array(Tuple(\n t Int32,\n s String))))) Array(Array(Array(String))) +[[[[(1,'d')]]]] [[['d']]] Array(Array(Array(Nested(t Int32, s String)))) Array(Array(Array(String))) [[[[1]]]] [[[['d']]]] Array(Array(Array(Array(Int32)))) Array(Array(Array(Array(String)))) [([([([(1,'d')],'d')],'s')],'s')] Array(Tuple(\n t Array(Tuple(\n t Array(Tuple(\n t Array(Tuple(\n t Int32,\n s String)),\n s String)),\n s String)),\n s String)) [[([([(1,'d')],'d')],'s')]] Array(Nested(t Nested(t Nested(t Int32, s String), s String), s String)) [[[([(1,'d')],'d')]]] Array(Array(Array(Tuple(Array(Tuple(Int64, String)), String)))) [[[[1]]]] Array(Array(Array(Array(Int32)))) [[([([(1,'d')],'d')],'s')]] ['s'] Array(Array(Tuple(\n t Array(Tuple(\n t Array(Tuple(\n t Int32,\n s String)),\n s String)),\n s String))) Array(String) -[[[([(1,'d')],'d')]]] [['s']] Array(Array(Array(Tuple(\n t Array(Tuple(\n t Int32,\n s String)),\n s String)))) Array(Array(String)) +[[[([(1,'d')],'d')]]] [['s']] Array(Array(Nested(t Nested(t Int32, s String), s String))) Array(Array(String)) [[[[(1,'d')]]]] [[['d']]] Array(Array(Array(Array(Tuple(Int64, String))))) Array(Array(Array(String))) [[[[1]]]] [[[['d']]]] Array(Array(Array(Array(Int32)))) Array(Array(Array(Array(String)))) [([([([(1,'d')],'d')],'s')],'s')] Array(Tuple(\n t Array(Tuple(\n t Array(Tuple(\n t Array(Tuple(\n t Int32,\n s String)),\n s String)),\n s String)),\n s String)) diff --git a/tests/queries/0_stateless/03237_get_subcolumn_low_cardinality_column.reference b/tests/queries/0_stateless/03237_get_subcolumn_low_cardinality_column.reference new file mode 100644 index 00000000000..50c25a86b2f --- /dev/null +++ b/tests/queries/0_stateless/03237_get_subcolumn_low_cardinality_column.reference @@ -0,0 +1 @@ +LowCardinality(String) diff --git a/tests/queries/0_stateless/03237_get_subcolumn_low_cardinality_column.sql b/tests/queries/0_stateless/03237_get_subcolumn_low_cardinality_column.sql new file mode 100644 index 00000000000..4d4755541f5 --- /dev/null +++ b/tests/queries/0_stateless/03237_get_subcolumn_low_cardinality_column.sql @@ -0,0 +1 @@ +SELECT toTypeName(getSubcolumn(tuple('str')::Tuple(a LowCardinality(String)), 'a'))