jacktengg commented on code in PR #69271:
URL: https://github.com/apache/doris/pull/69271#discussion_r4312747192


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java:
##########
@@ -1533,28 +1523,13 @@ private static Expression 
processComparisonPredicateInternal(ComparisonPredicate
         left = comparisonPredicate.left();
         right = comparisonPredicate.right();
 
-        if (isJoinCondition && comparisonPredicate instanceof EqualPredicate
-                && isTimeStampNsAndJoinCompatibleTemporalPair(
-                        left.getDataType(), right.getDataType())) {
-            left = strictCastIfNotSameType(left, TimeStampNsType.INSTANCE);
-            right = strictCastIfNotSameType(right, TimeStampNsType.INSTANCE);
-            return comparisonPredicate.withChildren(left, right);
-        }
-
         boolean timeStampNsDateLikePair = isTimeStampNsAndDateLikePair(
                 left.getDataType(), right.getDataType());
         Optional<DataType> commonType;
         if (timeStampNsDateLikePair) {
-            commonType = findExactCommonTypeForTimeStampNsAndDateLike(
-                    ImmutableList.of(left, right));
-            // The BE comparison kernel compares TIMESTAMP_NS and DATETIMEV2 
exactly. Date-like
-            // peers with no exact common type can first be widened losslessly 
to DATETIMEV2.
-            if (!commonType.isPresent()) {
-                Optional<Expression> normalized = 
normalizeTimeStampNsDateLikeComparison(comparisonPredicate);
-                if (normalized.isPresent()) {
-                    return normalized.get();
-                }
-            }
+            // Storage predicates require the constant and column to share a 
representation.
+            // Always promote the temporal peer, preserving nanoseconds and 
failing on overflow.
+            commonType = Optional.of(TimeStampNsType.INSTANCE);

Review Comment:
   Use DELETE FROM t WHERE d = '2024-01-01 00:00:00', does not support DELETE 
FROM t WHERE d = CAST('2024-01-01 00:00:00' AS TIMESTAMP_NS).



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