Skip to content

Handle the timezone in extract week in temporal.rs #1380

@Ted-Jiang

Description

@Ted-Jiang

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

/// Extracts the week of a given temporal array as an array of integers
pub fn week<T>(array: &PrimitiveArray<T>) -> Result<Int32Array>
where
    T: ArrowTemporalType + ArrowNumericType,
    i64: std::convert::From<T::Native>,
{
    let mut b = Int32Builder::new(array.len());

    match array.data_type() {
        &DataType::Date32 | &DataType::Date64 | &DataType::Timestamp(_, None) => {
            extract_component_from_array!(array, b, iso_week, week, value_as_datetime)
        }
        dt => return_compute_error_with!("week does not support", dt),
    }

    Ok(b.finish())
}

Now week not support Timestamp with timezone.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new improvement worthy of a entry in the changelog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions