diff --git a/src/sql/src/func.rs b/src/sql/src/func.rs index b7f80797264f8..b0061a2edb6ca 100644 --- a/src/sql/src/func.rs +++ b/src/sql/src/func.rs @@ -1627,6 +1627,17 @@ fn coerce_args_to_types( // polymorphic type. PlanError::UnsolvablePolymorphicFunctionInput })?; + if let SqlScalarType::Array(elem) = &target { + if matches!( + **elem, + SqlScalarType::List { .. } | SqlScalarType::Map { .. } + ) { + bail_unsupported!(format!( + "{}[]", + ecx.humanize_sql_scalar_type(elem, false) + )); + } + } do_convert(cexpr, &target)? } }; diff --git a/test/sqllogictest/arrays.slt b/test/sqllogictest/arrays.slt index 04d323f77a576..f2b4ad8639234 100644 --- a/test/sqllogictest/arrays.slt +++ b/test/sqllogictest/arrays.slt @@ -585,6 +585,21 @@ SELECT array_remove(ARRAY[1,1,1], 1) query error removing elements from multidimensional arrays is not supported SELECT array_remove(ARRAY[[1]], 1) +query error integer list\[\] not yet supported +SELECT array_remove(NULL, LIST[1]) + +query error map\[text=>integer\]\[\] not yet supported +SELECT array_remove(NULL, '{a=>1}'::map[text=>int4]) + +statement ok +CREATE TABLE t0 (c3 int4 list) + +query error integer list\[\] not yet supported +SELECT array_remove('[2020-01-01,2021-01-01)', t0.c3) AS col0 FROM t0 + +statement ok +DROP TABLE t0 + # array_cat query T