MaxGekk opened a new pull request #26358: [SPARK-29712][SQL] Take into account 
the left bound in `fromDayTimeString()`
URL: https://github.com/apache/spark/pull/26358
 
 
   ### What changes were proposed in this pull request?
   In the PR, I propose to check the left bound - the `from` interval unit, and 
reset all unit values out of the specified range of interval units. Currently, 
`IntervalUtils.fromDayTimeString()` takes into account only the right bound but 
not the left one. 
   
   ### Why are the changes needed?
   This fix makes `fromDayTimeString()` consistent in bound handling.
   
   ### Does this PR introduce any user-facing change?
   Yes, before:
   ```sql
   spark-sql> SELECT interval '1 2:03:04' hour to minute;
   interval 1 days 2 hours 3 minutes
   ```
   After:
   ```sql
   spark-sql> SELECT interval '1 2:03:04' hour to minute;
   interval 2 hours 3 minutes
   ```
   
   ### How was this patch tested?
   - Added new tests to `IntervalUtilsSuite`
   - Fixed expected results for `literals.sql` and `interval.sql`

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

Reply via email to