zclllyybb commented on code in PR #51270:
URL: https://github.com/apache/doris/pull/51270#discussion_r2123768617


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ComputeSignatureHelper.java:
##########
@@ -376,59 +380,83 @@ public static FunctionSignature 
dynamicComputePropertiesOfArray(
                 ArrayType.of(arrayType.getItemType(), arrayType.containsNull() 
|| containsNull));
     }
 
-    private static FunctionSignature defaultDateTimeV2PrecisionPromotion(
-            FunctionSignature signature, List<Expression> arguments) {
-        DateTimeV2Type finalType = null;
+    // for time type with precision(now are DateTimeV2Type and TimeV2Type),
+    // we will promote the precision of the type to the maximum precision of 
all arguments
+    private static FunctionSignature 
defaultTimePrecisionPromotion(FunctionSignature signature,
+            List<Expression> arguments) {
+        ImmutableList.Builder<DataType> newArgTypesBuilder = 
ImmutableList.builderWithExpectedSize(signature.arity);
+
+        int finalTypeScale = -1;
         for (int i = 0; i < arguments.size(); i++) {
-            DataType targetType;
+            DataType signatureArgType;
             if (i >= signature.argumentsTypes.size()) {
                 Preconditions.checkState(signature.getVarArgType().isPresent(),
                         "argument size larger than signature");
-                targetType = signature.getVarArgType().get();
+                signatureArgType = signature.getVarArgType().get();
             } else {
-                targetType = signature.getArgType(i);
+                signatureArgType = signature.getArgType(i);
             }
-            List<DataType> argTypes = extractArgumentType(DateTimeV2Type.class,
-                    targetType, arguments.get(i).getDataType());
-            if (argTypes.isEmpty()) {
+            List<DataType> nestedTypes = 
extractArgumentTypeBySignature(DateTimeV2Type.class,

Review Comment:
   because it's nested type. for example, the result is [K, V, T] if the 
argument is Map<K, Array<Map<V, T>>>



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