eldenmoon commented on code in PR #48894:
URL: https://github.com/apache/doris/pull/48894#discussion_r1990685198


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelper.java:
##########
@@ -429,28 +429,50 @@ private static FunctionSignature 
defaultDateTimeV2PrecisionPromotion(
         return signature;
     }
 
-    /** dynamicComputeVariantArgs */
+    /**
+     * Dynamically compute function signature for variant type arguments.
+     * This method handles cases where the function signature contains variant 
types
+     * and needs to be adjusted based on the actual argument types.
+     *
+     * @param signature Original function signature
+     * @param arguments List of actual arguments passed to the function
+     * @return Updated function signature with resolved variant types
+     */
     public static FunctionSignature dynamicComputeVariantArgs(
             FunctionSignature signature, List<Expression> arguments) {
+
         List<DataType> newArgTypes = 
Lists.newArrayListWithCapacity(arguments.size());
         boolean findVariantType = false;
+
         for (int i = 0; i < arguments.size(); i++) {
+            // Get signature type for current argument position
             DataType sigType;
             if (i >= signature.argumentsTypes.size()) {
                 sigType = signature.getVarArgType().orElseThrow(
                         () -> new AnalysisException("function arity not match 
with signature"));
             } else {
                 sigType = signature.argumentsTypes.get(i);
             }
+
+            // Get actual type of the argument expression
             DataType expressionType = arguments.get(i).getDataType();
+

Review Comment:
   add test case



-- 
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