github-actions[bot] commented on code in PR #66843:
URL: https://github.com/apache/doris/pull/66843#discussion_r3795568931
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayMicrosecondAdd.java:
##########
@@ -80,6 +80,9 @@ public Expression withConstantArgs(Expression literal) {
@Override
public FunctionSignature computeSignature(FunctionSignature signature) {
signature = super.computeSignature(signature);
+ if (signature.argumentsTypes.get(0) instanceof TimeStampTzType) {
Review Comment:
[P1] Select the TIMESTAMPTZ family before forcing scale 6
For the test's `ts TIMESTAMPTZ(3)`, neither concrete MAX-scale signature
matches identically. In the implicit round both candidates match, receive equal
scores, and `SearchSignature` keeps the first `DATETIMEV2(6)` signature.
Because search runs before this method, `super.computeSignature` has already
lost the source family and this condition is false:
```text
Project(day_microsecond_add(
CAST(ts#1: TIMESTAMPTZ(3) AS DATETIMEV2(6)), interval
) : DATETIMEV2(6))
```
Thus typed TIMESTAMPTZ columns, casts, and literals at scales 0-5 still take
the old session-local DATETIMEV2 path in all six changed classes; only scale 6
and zoned string literals reach this branch. Please use wildcard-scale family
signatures (the established sibling pattern), or otherwise preserve the typed
family during selection without regressing the existing zoned-string selection,
before promoting the selected family to scale 6. Also cover typed scales below
6.
##########
regression-test/data/datatype_p0/timestamptz/test_timestamptz_microsecond_interval.out:
##########
@@ -0,0 +1,4 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !timestamptz_microsecond_interval --
+1 2024-01-03T05:07:09.246456 2024-01-01T01:01:00.999544
2024-01-02T05:07:09.246456 2024-01-02T01:01:00.999544
2024-01-02T03:07:09.246456 2024-01-02T03:01:00.999544
Review Comment:
[P1] Regenerate the existing zoned-literal expectations
This branch already changes timezone-bearing string literals: signature
search prefers the TIMESTAMPTZ overload for them, so their results now
serialize with an offset. `test_add_sub_union_type.groovy` has 18 existing
affected qts (day add 11-13/sub 5-7, hour add 10-12/sub 5-7, and minute add
11-13/sub 5-7), but its `.out` file is not changed and still contains
offset-free DATETIMEV2 values. The pre-existing
`second_microsecond_add_11`/`sub_5` outputs show the expected `+08:00` form.
Please regenerate that existing golden file as part of this change; otherwise
the existing regression suite fails. The offset-free row here also shows that
this test's scale-3 column still follows the wrong path described in the other
comment.
--
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]