[
https://issues.apache.org/jira/browse/DRILL-356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mehant Baid updated DRILL-356:
------------------------------
Description:
Add logic to support the following types in Drill:
Date - Stores date alone (timezoneless)
DateTime - Stores date and time (timezoneless)
Time - Stores time only (timezoneless)
TimeStamp - Stores date and time, contains timezone information
Interval - Used to store an interval of time, following are the parameters
which can combine to form an interval type (year, months, days, hours, minutes,
seconds, milliseconds)
IntervalYear - Used to store an interval of time in years, months
IntervalDay - Stores an interval of time in days to seconds i.e: days, hours,
minutes, seconds, milliseconds
Internally Date, DateTime use a long field to store milliseconds. It represents
time since epoch in UTC.
Since TimeStamp has a timezone associated with it, it additionally uses an int
field to store the timezone index. We maintain a static list of all existing
timezones and the int field within TimeStamp represents an index into this
list.
Time uses an integer field to store a given time of day
Interval type is used to represent a period of time use one or more of the
following fields: Year, month, day, hour, minute, second, millisecond.
Internally we convert and store only three fields: months, days, milliseconds.
There is a one to one mapping available between all possible fields and out
internal fields. Eg: Year to month is (1 Year = 12 months) and so on.
IntervalYear and IntervalDay are a simpler version of Interval with a subset of
the fields.
We use Joda libraries underneath when we want to perform date arithmetic, time
zone conversion etc. Although for comparison functions we don't use Joda
because our internal representation (of milliseconds) is sufficient enough for
all comparisons.
was:
Add logic to support the following types in Drill:
Date - Stores date alone (timezoneless)
DateTime - Stores date and time (timezoneless)
Time - Stores time only (timezoneless)
TimeStamp - Stores date and time, contains timezone information
Interval - Used to store an interval of time, following are the parameters
which can combine to form an interval type (year, months, days, hours, minutes,
seconds, milliseconds)
Except the Interval type all the other data types internally use a java long
field to store milliseconds. It represents time since epoch in UTC. Since
TimeStamp has a timezone associated with it, it additionally uses an int field
to store the timezone index. We maintain a static list of all existing
timezones and the int field within TimeStamp represents an index into this
list.
Interval type is used to represent a period of time use one or more of the
following fields: Year, month, day, hour, minute, second, millisecond.
Internally we convert and store only three fields: months, days, milliseconds.
There is a one to one mapping available between all possible fields and out
internal fields. Eg: Year to month is (1 Year = 12 months) and so on.
We use Joda libraries underneath when we want to perform date arithmetic, time
zone conversion etc. Although for comparison functions we don't use Joda
because our internal representation (of milliseconds) is sufficient enough for
all comparisons.
> Implement support for Date type
> -------------------------------
>
> Key: DRILL-356
> URL: https://issues.apache.org/jira/browse/DRILL-356
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Mehant Baid
> Assignee: Mehant Baid
> Attachments: DRILL-356.patch
>
>
> Add logic to support the following types in Drill:
> Date - Stores date alone (timezoneless)
> DateTime - Stores date and time (timezoneless)
> Time - Stores time only (timezoneless)
> TimeStamp - Stores date and time, contains timezone information
> Interval - Used to store an interval of time, following are the parameters
> which can combine to form an interval type (year, months, days, hours,
> minutes, seconds, milliseconds)
> IntervalYear - Used to store an interval of time in years, months
> IntervalDay - Stores an interval of time in days to seconds i.e: days, hours,
> minutes, seconds, milliseconds
> Internally Date, DateTime use a long field to store milliseconds. It
> represents time since epoch in UTC.
> Since TimeStamp has a timezone associated with it, it additionally uses an
> int field to store the timezone index. We maintain a static list of all
> existing timezones and the int field within TimeStamp represents an index
> into this list.
> Time uses an integer field to store a given time of day
> Interval type is used to represent a period of time use one or more of the
> following fields: Year, month, day, hour, minute, second, millisecond.
> Internally we convert and store only three fields: months, days,
> milliseconds. There is a one to one mapping available between all possible
> fields and out internal fields. Eg: Year to month is (1 Year = 12 months) and
> so on. IntervalYear and IntervalDay are a simpler version of Interval with a
> subset of the fields.
> We use Joda libraries underneath when we want to perform date arithmetic,
> time zone conversion etc. Although for comparison functions we don't use Joda
> because our internal representation (of milliseconds) is sufficient enough
> for all comparisons.
--
This message was sent by Atlassian JIRA
(v6.2#6252)