MaxGekk opened a new pull request #24316: [SPARK-27405][SQL][TEST] Restrict the 
range of generated random timestamps
URL: https://github.com/apache/spark/pull/24316
 
 
   ## What changes were proposed in this pull request?
   
   In the PR, I propose to restrict the range of random timestamp literals 
generated in `LiteralGenerator. timestampLiteralGen`. The generator creates 
instances of `java.sql.Timestamp` by passing milliseconds since epoch as `Long` 
type. Converting the milliseconds to microseconds can cause arithmetic overflow 
of Long type because Catalyst's Timestamp type stores microseconds since epoch 
in `Long` type internally as well. Proposed interval of random milliseconds is 
`[Long.MinValue / 1000, Long.MaxValue / 1000]`.
   
   ## How was this patch tested?
   
   By `DateExpressionsSuite` in the PR 
https://github.com/apache/spark/pull/24311

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