[
https://issues.apache.org/jira/browse/SPARK-8864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14617846#comment-14617846
]
Cheng Hao commented on SPARK-8864:
----------------------------------
Long = 2 ^ 63 = 9.2E18, the timestamp is in us, the max value is
2*10000*365*24*60*60* E7=6.3E18, so LONG will be enough for timestamp,right?
And probably 8 bytes is enough for internal representation of `interval`:
Let's say the first 18 bits for month, and the later 46 bits are for us.
Month(18 bits): max value = 10000 * 12, still less than 2^18(262,144) (the
highest bit will always be 0).
us(46 bits): max value is 31 * 24 * 3600 * 1E7 = 2.67E13, still less than
2^46(7.0E13)
Let me know if I made mistake in the calculation.
> Date/time function and data type design
> ---------------------------------------
>
> Key: SPARK-8864
> URL: https://issues.apache.org/jira/browse/SPARK-8864
> Project: Spark
> Issue Type: Sub-task
> Components: SQL
> Reporter: Reynold Xin
> Assignee: Reynold Xin
> Fix For: 1.5.0
>
> Attachments: SparkSQLdatetimeudfs (1).pdf
>
>
> Please see the attached design doc.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]