Description
We should create an IntervalType data type that represents time intervals. Internally, we can use a long value to store it, similar to Timestamp (i.e. 100ns precision). This data type initially cannot be stored externally, but only used for expressions.
1. Add IntervalType data type.
2. Add parser support in our SQL expression, in the form of
INTERVAL [number] [unit]
unit can be YEAR[S], MONTH[S], WEEK[S], DAY[S], HOUR[S], MINUTE[S], SECOND[S], MILLISECOND[S], MICROSECOND[S], or NANOSECOND[S].
3. Add in the analyzer to make sure we throw some exception to prevent saving a dataframe/table with IntervalType out to external systems.
Related Hive ticket: https://issues.apache.org/jira/browse/HIVE-9792
Attachments
Issue Links
- blocks
-
SPARK-8186 date/time function: date_add
- Resolved
-
SPARK-8187 date/time function: date_sub
- Resolved
- links to