SEPURI-SAI-KRISHNA commented on PR #59135:
URL: https://github.com/apache/spark/pull/59135#issuecomment-7078036716

   @MaxGekk thanks.
   - `d - INTERVAL '1' DAY`: resolving it to `DateSub` would change its default 
column name, which is `date_add(d, (- extractansiintervaldays(INTERVAL '1' 
DAY)))` today (see `date.sql.out`). I'd rather not change that here, since the 
message is still correct, just worded as an add. If you still prefer `DateSub`, 
I'll switch it and regenerate the golden files.
   - BIGINT count: `DateAdd` and `DateSub` are `ExpectsInputTypes`, not 
`ImplicitCastInputTypes`, so a BIGINT is not cast to INT. 
`date_add(DATE'2020-01-01', 4294967297L)` and `DATE'2020-01-01' + 4294967297L` 
fail at analysis with `DATATYPE_MISMATCH.UNEXPECTED_INPUT_TYPE`, with ANSI on 
and off, also in the DataFrame API. A STRING count fails too 
(`SECOND_FUNCTION_ARGUMENT_NOT_INTEGER` or `CAST_INVALID_INPUT`). The wrap 
happens in functions that do cast, e.g. `add_months(DATE'2020-01-01', 
4294967297L)` returns `2020-02-01` with ANSI off. So I kept the note. If you 
hit it through another path, could you share the query?
   - A `RANGE` frame over a `DATE` with a `YEAR TO MONTH` offset, such as 
`INTERVAL '1' MONTH FOLLOWING`, still fails with `ARITHMETIC_OVERFLOW` at the 
ends of the `DATE` range, as `add_months` does. That is the same before this PR 
(`DateAddYMInterval`), so I'd handle it in a follow-up, if that works for you.
   - Trait: I'll drop the `copyTagsFrom` override once #60285 is in, and 
resolve the conflict in whichever of this and #60134 merges second.
   


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