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/04/07 22:12:24 UTC

[GitHub] [spark] MaxGekk opened a new pull request #24316: [SPARK-27405][SQL][TEST] Restrict the range of generated random timestamps

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