Search before asking
Version
Apache Doris 4.1.3-rc02, commit 31263df4dc1d4d3a27517d264802cd4d6b92c874
Client: Python + ADBC Flight SQL driver (adbc_driver_flightsql), FE arrow_flight_sql_port = 41070.
The MySQL/JDBC protocol is used as the control path for comparison.
What's Wrong?
When reading a mapped Iceberg TIMESTAMPTZ column with the session time_zone set to UTC, Doris Flight SQL returns the Arrow type timestamp[s, tz=Z].
PyArrow treats the timezone string as a zoneinfo key, so to_pylist() raises ZoneInfoNotFoundError because Z is not a valid IANA time zone name. The underlying epoch values themselves are correct: [1735704000, null, 939528000, null]. Rewriting only the schema metadata from Z to UTC leaves the epochs unchanged and makes the conversion succeed.
What You Expected?
UTC timezone metadata should use a name that PyArrow / zoneinfo can resolve (e.g. UTC, or a fixed +00:00 offset), so that to_pylist() returns UTC datetimes directly.
How to Reproduce?
- Bring up the Iceberg regression fixture and create a catalog with
"enable.mapping.timestamp_tz" = "true".
SWITCH to that catalog, USE test_timestamp_tz, and set the session time_zone to UTC.
- Read
test_ice_timestamp_tz_orc over Python ADBC Flight SQL.
- Inspect the Arrow schema and call
to_pylist().
SWITCH test_iceberg_timestamp_tz_with_mapping;
USE test_timestamp_tz;
SET time_zone = 'UTC';
SELECT * FROM test_ice_timestamp_tz_orc ORDER BY id;
Client side:
import adbc_driver_flightsql.dbapi as flight_sql
conn = flight_sql.connect(uri="grpc://127.0.0.1:41070",
db_kwargs={"username": "root", "password": ""})
cur = conn.cursor()
cur.execute("SET time_zone = 'UTC'")
cur.execute("SELECT * FROM test_iceberg_timestamp_tz_with_mapping."
"test_timestamp_tz.test_ice_timestamp_tz_orc ORDER BY id")
table = cur.fetch_arrow_table()
print(table.schema) # timestamp[s, tz=Z]
print(table.to_pylist()) # ZoneInfoNotFoundError
Anything Else?
Z is valid ISO-8601 offset syntax but is not a portable Arrow timezone string; the Arrow spec expects either an IANA name or a fixed +HH:MM offset. The Doris session time_zone value is apparently passed through to the Arrow field metadata verbatim.
Workaround: on the client, cast only the Arrow timezone metadata from Z to UTC before converting to Python; this does not change the epoch values. Casting to STRING in SQL also works, but loses the native TIMESTAMPTZ Arrow type.
Found with the external_table_p0/iceberg/test_iceberg_timestamp_tz fixture and confirmed with a raw Arrow probe plus a metadata-only cast.
Tracking issue: #65615
Are you willing to submit PR?
Code of Conduct
Search before asking
Version
Apache Doris 4.1.3-rc02, commit
31263df4dc1d4d3a27517d264802cd4d6b92c874Client: Python + ADBC Flight SQL driver (
adbc_driver_flightsql), FEarrow_flight_sql_port= 41070.The MySQL/JDBC protocol is used as the control path for comparison.
What's Wrong?
When reading a mapped Iceberg
TIMESTAMPTZcolumn with the sessiontime_zoneset toUTC, Doris Flight SQL returns the Arrow typetimestamp[s, tz=Z].PyArrow treats the timezone string as a
zoneinfokey, soto_pylist()raisesZoneInfoNotFoundErrorbecauseZis not a valid IANA time zone name. The underlying epoch values themselves are correct:[1735704000, null, 939528000, null]. Rewriting only the schema metadata fromZtoUTCleaves the epochs unchanged and makes the conversion succeed.What You Expected?
UTC timezone metadata should use a name that PyArrow /
zoneinfocan resolve (e.g.UTC, or a fixed+00:00offset), so thatto_pylist()returns UTC datetimes directly.How to Reproduce?
"enable.mapping.timestamp_tz" = "true".SWITCHto that catalog,USE test_timestamp_tz, and set the sessiontime_zonetoUTC.test_ice_timestamp_tz_orcover Python ADBC Flight SQL.to_pylist().Client side:
Anything Else?
Zis valid ISO-8601 offset syntax but is not a portable Arrow timezone string; the Arrow spec expects either an IANA name or a fixed+HH:MMoffset. The Doris sessiontime_zonevalue is apparently passed through to the Arrow field metadata verbatim.Workaround: on the client, cast only the Arrow timezone metadata from
ZtoUTCbefore converting to Python; this does not change the epoch values. Casting toSTRINGin SQL also works, but loses the nativeTIMESTAMPTZArrow type.Found with the
external_table_p0/iceberg/test_iceberg_timestamp_tzfixture and confirmed with a raw Arrow probe plus a metadata-only cast.Tracking issue: #65615
Are you willing to submit PR?
Code of Conduct