MaxGekk opened a new pull request #26180: [SPARK-29524][SQL] Support unordered interval units in casting from strings URL: https://github.com/apache/spark/pull/26180 ### What changes were proposed in this pull request? In the PR, I propose to replace existing implementation of `CalendarInterval`.`fromCaseInsensitiveString` based on a regexp by another implementation using finite state machine. The existing regex assumes particular order of interval units from `YEAR` to `MICROSECOND`. Modification of the regexp becomes very hard to support new features. ### Why are the changes needed? - This improves Spark SQL UX by allowing users to specify interval units in any order - Existing regex is hard to extend - To maintain feature parity with PostgreSQL ### Does this PR introduce any user-facing change? No ### How was this patch tested? - By existing tests in `CalendarIntervalSuite` - Add new test for invalid unit `dday` - By new tests for uniqueness and unordered interval units in `CalendarIntervalSuite`
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
