starocean999 commented on code in PR #64026:
URL: https://github.com/apache/doris/pull/64026#discussion_r3419228443


##########
fe/fe-core/src/main/java/org/apache/doris/clone/DynamicPartitionScheduler.java:
##########
@@ -298,16 +300,23 @@ private ArrayList<AddPartitionOp> 
getAddPartitionOp(Database db, OlapTable olapT
                 nowPartitionPrevBorder, 
dynamicPartitionProperty.getTimeUnit());
 
         for (; idx <= dynamicPartitionProperty.getEnd(); idx++) {
-            String prevBorder = DynamicPartitionUtil.getPartitionRangeString(
-                    dynamicPartitionProperty, now, idx, partitionFormat);
-            String nextBorder = DynamicPartitionUtil.getPartitionRangeString(
-                    dynamicPartitionProperty, now, idx + 1, partitionFormat);
-            PartitionValue lowerValue = new PartitionValue(prevBorder);
-            PartitionValue upperValue = new PartitionValue(nextBorder);
-
             boolean isPartitionExists = false;
             Range<PartitionKey> addPartitionKeyRange;
+            PartitionValue lowerValue;
+            PartitionValue upperValue;

Review Comment:
   done



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java:
##########
@@ -655,27 +653,15 @@ public static Optional<Expression> 
characterLiteralTypeCoercion(String value, Da
                     && DateTimeChecker.isValidDateTime(value)) {
                 ret = DateTimeLiteral.parseDateTimeLiteral(value, 
true).orElse(null);
             } else if (dataType.isTimeStampTzType() && 
DateTimeChecker.isValidDateTime(value)) {
-                if (DateTimeChecker.hasTimeZone(value)) {
-                    // Signature search can pass TIMESTAMPTZ(*) here. 
TimestampTzLiteral rounds by scale,
-                    // so derive a concrete scale from the literal before 
preserving its explicit offset.
-                    TimeStampTzType timeStampTzType = (TimeStampTzType) 
dataType;
-                    if (timeStampTzType.getScale() < 0) {
-                        timeStampTzType = 
TimeStampTzType.forTypeFromString(value);
-                    }
-                    ret = new TimestampTzLiteral(timeStampTzType, value);
-                } else {
-                    DateTimeV2Literal dtV2Lit = (DateTimeV2Literal) 
DateTimeLiteral
-                                    .parseDateTimeLiteral(value, 
true).orElse(null);
-                    if (dtV2Lit != null) {
-                        dtV2Lit = (DateTimeV2Literal) 
(DateTimeExtractAndTransform.convertTz(
-                                dtV2Lit,
-                                new 
StringLiteral(ConnectContext.get().getSessionVariable().timeZone),
-                                new StringLiteral("UTC")));
-                        ret = new TimestampTzLiteral(dtV2Lit.getYear(), 
dtV2Lit.getMonth(), dtV2Lit.getDay(),
-                                dtV2Lit.getHour(), dtV2Lit.getMinute(), 
dtV2Lit.getSecond(),
-                                dtV2Lit.getMicroSecond());
-                    }
+                // Signature search can pass TIMESTAMPTZ(*) here. 
TimestampTzLiteral rounds by scale,
+                // so derive a concrete scale from the literal before parsing.
+                TimeStampTzType timeStampTzType = (TimeStampTzType) dataType;
+                if (timeStampTzType.getScale() < 0) {
+                    timeStampTzType = TimeStampTzType.forTypeFromString(value);
+                } else if (dataType == TimeStampTzType.MAX && 
!DateTimeChecker.hasTimeZone(value)) {
+                    timeStampTzType = TimeStampTzType.forTypeFromString(value);

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