Skip to content

[Bug] ArrowFlight SQL result automatically converts timezone naive date to UTC (which is wrong) #65741

Description

@wushilin

Search before asking

  • I had searched in the issues and found no similar issues.

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?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions