You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/25 15:33:32 UTC

[GitHub] [spark] MaxGekk opened a new pull request #26256: [WIP][SPARK-29605][SQL] Optimize string to interval casting

MaxGekk opened a new pull request #26256: [WIP][SPARK-29605][SQL] Optimize string to interval casting
URL: https://github.com/apache/spark/pull/26256
 
 
   ### What changes were proposed in this pull request?
   In the PR, I propose new function `stringToInterval()` in `IntervalUtils` for converting `UTF8String` to `CalendarInterval`. The function is used in casting a `STRING` column to an `INTERVAL` column.
   
   ### Why are the changes needed?
   The proposed implementation is ~10 times faster. For example, parsing 9 interval units on JDK 8:
   Before:
   ```
   9 units w/ interval                               14004          14125         116          0.1       14003.6       0.0X
   9 units w/o interval                              13785          14056         290          0.1       13784.9       0.0X
   ```
   After:
   ```
   9 units w/ interval                                1343           1344           1          0.7        1343.0       0.3X
   9 units w/o interval                               1345           1349           8          0.7        1344.6       0.3X
   ```
   
   ### Does this PR introduce any user-facing change?
   No
   
   ### How was this patch tested?
   - By new tests for `stringToInterval` in `IntervalUtilsSuite`
   - By existing tests
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org