-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Summary
When fetching PostgreSQL TIMESTAMPTZ columns, the Arrow schema declares Timestamp(Microsecond, Some("UTC")) but the actual data is created with Timestamp(Microsecond, None), causing a schema mismatch error.
Root Cause
In src/datafetch/native/postgres.rs:
pg_type_to_arrow("timestamptz")correctly returnsDataType::Timestamp(Microsecond, Some("UTC"))- However,
make_builder()at line ~372 creates the builder without timezone info:DataType::Timestamp(_, _) => Box::new(TimestampMicrosecondBuilder::with_capacity(capacity)),
The TimestampMicrosecondBuilder creates arrays with None timezone by default.
Fix
Use TimestampMicrosecondBuilder::with_capacity(capacity).with_timezone_opt(tz.clone()) to preserve the timezone from the schema.
Discovered By
Type coverage tests in tests/type_coverage/postgres_types.rs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels