pub enum DatePart {
Year,
Month,
Day,
Hour,
Minute,
Second,
Millisecond,
Microsecond,
Nanosecond,
}Expand description
Date or timestamp field named by EXTRACT or DATE_TRUNC.
Variants§
Year
Calendar year field.
Month
Calendar month field.
Day
Day of month for extraction, or day boundary for truncation.
Hour
Hour field for extraction, or hour boundary for truncation.
Minute
Minute field for extraction, or minute boundary for truncation.
Second
Second field for extraction, or second boundary for truncation.
Millisecond
Millisecond field for extraction, or millisecond boundary for truncation.
Microsecond
Microsecond field for extraction, or microsecond boundary for truncation.
Nanosecond
Nanosecond boundary for timestamp truncation.
Implementations§
Source§impl DatePart
impl DatePart
Sourcepub const EXTRACT_DATE_FIELDS: [Self; 3]
pub const EXTRACT_DATE_FIELDS: [Self; 3]
Fields native EXTRACT reads from a Date32 or a timezone-free
timestamp.
Sourcepub const EXTRACT_TIME_FIELDS: [Self; 5]
pub const EXTRACT_TIME_FIELDS: [Self; 5]
Fields native EXTRACT reads from a timezone-free timestamp only. As in
DataFusion, MILLISECOND and MICROSECOND include the whole seconds
of the minute, and sub-unit remainders are dropped.
Sourcepub const EXTRACT_FIELDS: [Self; 8]
pub const EXTRACT_FIELDS: [Self; 8]
Fields native EXTRACT returns: Self::EXTRACT_DATE_FIELDS and
Self::EXTRACT_TIME_FIELDS. NANOSECOND is not native.
Sourcepub const DATE_TRUNC_FIELDS: [Self; 7]
pub const DATE_TRUNC_FIELDS: [Self; 7]
Fields native DATE_TRUNC floors a timestamp to: the fixed-duration
ones. Calendar months and years are not.
Sourcepub fn from_sql_name(name: &str) -> Option<Self>
pub fn from_sql_name(name: &str) -> Option<Self>
The field a SQL field name names, ignoring case.