delta-io / delta-rs

A native Rust library for Delta Lake, with bindings into Python
https://delta-io.github.io/delta-rs/
Apache License 2.0
1.98k stars 365 forks source link

Running the basic_operations examples fails with `Error: Transaction { source: WriterFeaturesRequired(TimestampWithoutTimezone) `} #2552

Closed imor closed 1 month ago

imor commented 1 month ago

Environment

Delta-rs version: main branch

Binding: Rust

Environment:


Bug

What happened:

Running basic_operations examples fails with Error: Transaction { source: WriterFeaturesRequired(TimestampWithoutTimezone) }

What you expected to happen:

Example runs successfully

How to reproduce it:

From the delta-rs/crates/deltalake folder run cargo run --features="datafusion" --example basic_operations

More details: I have tracked the error down to these lines: https://github.com/delta-io/delta-rs/blob/752eef51f6a4f6d52ee8a6f315cec11bb469741a/crates/core/src/operations/transaction/protocol.rs#L121-L123 But I'm not sure how to fix this. If I comment out these lines, the example does work.

jhoekx commented 1 month ago

The example was creating an Arrow array with timestamps without time zone. The delta data type was Timestamp, which is defined as having a UTC timezone, but it should be TimestampNtz to correspond to the data.