Search before asking
Version
When using arrow to execute sql:
SELECT CAST('2026-07-02 01:36:22.069504' AS DATETIME(6)) AS ts
What's Wrong?
The result is automatically converted to UTC.
2026-07-02 01:36:22.069504+00:00
What You Expected?
The result sould be
2026-07-02 01:36:22.069504
This is the wrong assumption. the original timestamp might be local timezone timestamp.
How to Reproduce?
Execute
SELECT CAST('2026-07-02 01:36:22.069504' AS DATETIME(6)) AS ts
in python:
import adbc_driver_flightsql.dbapi as flightsql
from adbc_driver_manager import DatabaseOptions
from q_secrets import get_connection_details
details = get_connection_details("doris", flightsql=True)
connection = flightsql.connect(
uri=f"{details['driver']}://{details['hostname']}:{details['port']}",
db_kwargs={
DatabaseOptions.USERNAME.value: details["username"],
DatabaseOptions.PASSWORD.value: details["pwd"],
},
)
with connection.cursor() as cursor:
cursor.execute("SELECT CAST('2026-07-02 01:36:22.069504' AS DATETIME(6)) AS ts")
table = cursor.fetch_arrow_table()
field = table.schema.field("ts")
print("Arrow field:", field)
print("Field metadata:", field.metadata)
print("Value:", table["ts"].to_pylist())
connection.close()
Anything Else?
No response
Are you willing to submit PR?
Code of Conduct
Search before asking
Version
When using arrow to execute sql:
SELECT CAST('2026-07-02 01:36:22.069504' AS DATETIME(6)) AS ts
What's Wrong?
The result is automatically converted to UTC.
2026-07-02 01:36:22.069504+00:00
What You Expected?
The result sould be
2026-07-02 01:36:22.069504
This is the wrong assumption. the original timestamp might be local timezone timestamp.
How to Reproduce?
Execute
SELECT CAST('2026-07-02 01:36:22.069504' AS DATETIME(6)) AS ts
in python:
import adbc_driver_flightsql.dbapi as flightsql
from adbc_driver_manager import DatabaseOptions
from q_secrets import get_connection_details
details = get_connection_details("doris", flightsql=True)
connection = flightsql.connect(
uri=f"{details['driver']}://{details['hostname']}:{details['port']}",
db_kwargs={
DatabaseOptions.USERNAME.value: details["username"],
DatabaseOptions.PASSWORD.value: details["pwd"],
},
)
with connection.cursor() as cursor:
cursor.execute("SELECT CAST('2026-07-02 01:36:22.069504' AS DATETIME(6)) AS ts")
table = cursor.fetch_arrow_table()
field = table.schema.field("ts")
print("Arrow field:", field)
print("Field metadata:", field.metadata)
print("Value:", table["ts"].to_pylist())
connection.close()
Anything Else?
No response
Are you willing to submit PR?
Code of Conduct