Skip to content

confused result when cast timestamp with timezone to date32 #5598

Closed
@liukun4515

Description

@liukun4515

Which part is this question about

cast from timestamp with timezone to date32

Related issues

I modify the test_cast_timestamp_to_date32 UT to get the result of

apache/datafusion#9982

The result of

        let array =
            TimestampMillisecondArray::from(vec![Some(25201000), Some(111599000), None])
                .with_timezone("-07:00".to_string());

is

PrimitiveArray<Timestamp(Millisecond, Some("-07:00"))>
[
  1970-01-01T00:00:01-07:00,
  **1970-01-01T23:59:59-07:00,**
  null,
]

the second value of timestamp is 1970-01-01T23:59:59-07:00, but the result of date32 is 1970-01-02.

It's confused with me, and also is different from other engine.

Describe your question

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions