MaxGekk opened a new pull request #28886:
URL: https://github.com/apache/spark/pull/28886


   ### What changes were proposed in this pull request?
   Replace Decimal by Int op in the `MakeInterval` & `MakeTimestamp` 
expression. For instance, `(secs * Decimal(MICROS_PER_SECOND)).toLong` can be 
replaced by the unscaled long because the former one already contains 
microseconds.
   
   ### Why are the changes needed?
   To improve performance.
   
   Before:
   ```
   make_timestamp():                         Best Time(ms)   Avg Time(ms)   
Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
   
------------------------------------------------------------------------------------------------------------------------
   ...
   make_timestamp(2019, 1, 2, 3, 4, 50.123456)             94             99    
       4         10.7          93.8      38.8X
   ```
   
   After:
   ```
   make_timestamp(2019, 1, 2, 3, 4, 50.123456)             76             92    
      15         13.1          76.5      48.1X
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   - By existing test suites `IntervalExpressionsSuite`, `DateExpressionsSuite` 
and etc.
   - Re-generate results of `MakeDateTimeBenchmark` in the environment:
   
   | Item | Description |
   | ---- | ----|
   | Region | us-west-2 (Oregon) |
   | Instance | r3.xlarge |
   | AMI | ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20190722.1 
(ami-06f2f779464715dc5) |
   | Java | OpenJDK 64-Bit Server VM 1.8.0_252 and OpenJDK 64-Bit Server VM 
11.0.7+10 |
   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to