github-actions[bot] commented on code in PR #66965:
URL: https://github.com/apache/doris/pull/66965#discussion_r3849402966


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -3249,6 +3247,10 @@ public Expression 
visitArithmeticBinary(ArithmeticBinaryContext ctx) {
         });
     }
 
+    private static UnboundFunction buildDateArithmetic(Expression date, 
Interval interval, String operation) {
+        return new UnboundFunction("DATE_" + operation, ImmutableList.of(date, 
interval));

Review Comment:
   [P1] Preserve TIMESTAMP_TZ in the compound-microsecond operator path
   
   This generic lowering makes the following expression bind successfully:
   
   ```text
   Project('2024-09-30 01:00:00+00:00' + INTERVAL '0 10:20:30.123456' 
DAY_MICROSECOND)
     -> DATE_ADD(timestamp_tz, interval)
     -> DayMicrosecondAdd(CAST(timestamp_tz AS DATETIMEV2(6)), value)
   ```
   
   `DayMicrosecondAdd/Sub`, `HourMicrosecondAdd/Sub`, and 
`MinuteMicrosecondAdd/Sub` all advertise a `TIMESTAMP_TZ` overload, but their 
`computeSignature` methods unconditionally replace argument 0 and the result 
with `DATETIMEV2(6)`. `ExpressionAnalyzer` therefore inserts a cast that drops 
the timezone; the existing explicit `date_add` regression already shows a 
`+00:00` input producing a zone-less value, whereas `SecondMicrosecondAdd/Sub` 
correctly preserve `TimeStampTzType.MAX`. Please preserve the matched 
timestamp-tz signature in all six classes and cover the three legal operator 
shapes with timestamp-tz type/output tests.
   



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