amorynan commented on code in PR #15966:
URL: https://github.com/apache/doris/pull/15966#discussion_r1086264303


##########
be/src/vec/functions/array/function_array_element.h:
##########
@@ -44,12 +46,18 @@ class FunctionArrayElement : public IFunction {
     size_t get_number_of_arguments() const override { return 2; }
 
     DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
-        DCHECK(is_array(arguments[0]))
-                << "first argument for function: " << name << " should be 
DataTypeArray";
-        DCHECK(is_integer(arguments[1]))
-                << "second argument for function: " << name << " should be 
Integer";
-        return make_nullable(
-                
check_and_get_data_type<DataTypeArray>(arguments[0].get())->get_nested_type());
+        DCHECK(is_array(arguments[0]) || is_map(arguments[0]))
+                << "first argument for function: " << name << " should be 
DataTypeArray or DataTypeMap";
+        if (is_array(arguments[0])) {
+            DCHECK(is_integer(arguments[1])) << "second argument for function: 
" << name << " should be Integer for array element";
+            return make_nullable(
+                    
check_and_get_data_type<DataTypeArray>(arguments[0].get())->get_nested_type());
+        } else {

Review Comment:
   done



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to