github-actions[bot] commented on code in PR #68576:
URL: https://github.com/apache/doris/pull/68576#discussion_r4121440675


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayContains.java:
##########
@@ -62,6 +64,10 @@ private ArrayContains(ScalarFunctionParams functionParams) {
     @Override
     public void checkLegalityBeforeTypeCoercion() {
         ArrayFunctionUtils.checkNoVarBinaryArguments(this);
+        DataType argType = getArgument(0).getDataType();
+        if (argType.isArrayType() && ((ArrayType) 
argType).getItemType().isComplexType()) {

Review Comment:
   The new check misses arrays whose element is initially NULL. For example, 
after this suite creates its table, `SELECT array_contains([NULL], map('a', 
id)) FROM test_array_contains_complex_type` enters this check as `ARRAY<NULL>`, 
so it passes. `getSignatures()` then uses the second MAP argument to resolve 
`Any0` and casts the first argument to `ARRAY<MAP<STRING, INT>>`. BE's 
`FunctionArrayIndex::_execute_dispatch` has no MAP dispatch and returns an 
unsupported-types error instead of rejecting this call during analysis. Please 
validate the resolved element type (or handle the all-NULL first-array case) 
and add a regression case with a row-dependent complex probe.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to