-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-47977] DateTimeUtils.timestampDiff and DateTimeUtils.timestamp…
…Add should not throw INTERNAL_ERROR exception ### What changes were proposed in this pull request? Convert `INTERNAL_ERROR` for `timestampAdd` and `timestampDiff` to error with class. Reusing `INVALID_PARAMETER_VALUE.DATETIME_UNIT` used when parsing expressions. The change is needed since `timestampDiff` and `timestampAdd` expressions could be constructed without going through parser - e.g. PySpark creates `timestampDiff` through PythonSQLUtils. ### Why are the changes needed? Correct classification of errors ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing unit tests updated with new error class ### Was this patch authored or co-authored using generative AI tooling? No Closes #46210 from vitaliili-db/SPARK-47977. Authored-by: Vitalii Li <[email protected]> Signed-off-by: Gengliang Wang <[email protected]>
- Loading branch information
1 parent
5d71ef0
commit 5baaa61
Showing
3 changed files
with
26 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters