Expand description
Defines temporal kernels for time and date related functions.
Re-exportsยง
use std::str::FromStr;๐use std::sync::Arc;๐use arrow_array::cast::AsArray;๐use cast::as_primitive_array;๐use chrono::Datelike;๐use chrono::TimeZone;๐use chrono::Timelike;๐use chrono::Utc;๐use arrow_array::temporal_conversions::MICROSECONDS;๐use arrow_array::temporal_conversions::MICROSECONDS_IN_DAY;๐use arrow_array::temporal_conversions::MILLISECONDS;๐use arrow_array::temporal_conversions::MILLISECONDS_IN_DAY;๐use arrow_array::temporal_conversions::NANOSECONDS;๐use arrow_array::temporal_conversions::NANOSECONDS_IN_DAY;๐use arrow_array::temporal_conversions::SECONDS_IN_DAY;๐use arrow_array::temporal_conversions::date32_to_datetime;๐use arrow_array::temporal_conversions::date64_to_datetime;๐use arrow_array::temporal_conversions::timestamp_ms_to_datetime;๐use arrow_array::temporal_conversions::timestamp_ns_to_datetime;๐use arrow_array::temporal_conversions::timestamp_s_to_datetime;๐use arrow_array::temporal_conversions::timestamp_us_to_datetime;๐use arrow_array::timezone::Tz;๐use arrow_schema::ArrowError;๐use arrow_schema::DataType;๐use arrow_schema::IntervalUnit;๐use arrow_schema::TimeUnit;๐pub(crate) use return_compute_error_with;๐use arrow_array::types::*;๐use arrow_array::*;๐
Macrosยง
Enumsยง
- Date
Part - Valid parts to extract from date/time/timestamp arrays.
Traitsยง
- Chrono
Date ๐Ext - Extract
Date ๐Part Ext - Implement the specialized functions for extracting date part from temporal arrays.
Functionsยง
- date_
part - Given an array, return a new array with the extracted
DatePartas signed 32-bit integer values. - get_
date_ ๐time_ part_ extract_ fn - Returns function to extract relevant
DatePartfrom types like aNaiveDateTimeorDateTime. - get_tz ๐
- Extract optional [
Tz] from timestamp data types, returning error if called with a non-timestamp type. - subsecond ๐
- Fractional second of
v, counted inunitsper second, rescaled totargetper second. Both scales divide one second evenly, so the conversion is exact when scaling up and truncating when scaling down. - timestamp_
time_ ๐part - Extracts a time-of-day part from a timestamp array without a timezone using
integer arithmetic. Returns
Nonefor parts that require a calendar conversion. - units_
per_ ๐second - Number of ticks in one second for timestamps of type
T.