Repository navigation
Open
Description
Summary
Surfaced by the multi-language coverage fan-out while conformance-testing these SPEC-IDs against databricks/databricks-sql-python. Each finding is committed as an expected-failure (xfail) test in the coverage PR — the test asserts the CORRECT (post-fix) behavior and stays red until THIS driver (databricks/databricks-sql-python) is fixed, then flips green as a tripwire.
Findings
- DATATYPE-043 [thrift]: cursor.description reports 'string' instead of TIME for a Thrift TIME result column at every declared precision; the Spark:DataType:SqlName logical-type remap covers only variant/geometry/geography
- failing test:
test_time_type_value_and_precision(see the coverage PR diff undertests/)
- failing test:
- DATATYPE-043 [sea]: the kernel/SEA path reports the raw Arrow spelling 'time64[ns]' instead of the TIME logical type in cursor.description, because the databricks.type_name allow-list in backend/kernel/type_mapping.py omits TIME
- failing test:
test_time_type_value_and_precision(see the coverage PR diff undertests/)
- failing test:
- DATATYPE-044 [thrift]: a NULL-only TIME column and a zero-row TIME result are reported as 'string' in cursor.description on Thrift instead of preserving the result-schema TIME logical type
- failing test:
test_null_time_and_zero_row_time_metadata(see the coverage PR diff undertests/)
- failing test:
- DATATYPE-044 [sea]: on the kernel/SEA path a NULL-only TIME column reports 'time64[ns]' and a zero-row TIME result reports 'string' in cursor.description, losing the TIME logical type the manifest declares
- failing test:
test_null_time_and_zero_row_time_metadata(see the coverage PR diff undertests/)
- failing test:
- DATATYPE-043: cursor.description reports no TIME logical type for a TIME result column: thrift reports 'string' (Spark:DataType:SqlName remap covers only variant/geometry/geography) and the kernel/SEA path reports the raw Arrow spelling 'time64[ns]' (databricks.type_name allow-list in backend/kernel/type_mapping.py omits TIME); decoded values and precisions are correct
- DATATYPE-044: a NULL-only TIME column and a zero-row TIME result lose the TIME logical type in cursor.description: thrift reports 'string', kernel/SEA reports 'time64[ns]' for the NULL-only column and 'string' for the zero-row result (the empty SEA manifest's UTF-8 physical schema), where the result-schema logical type must be preserved
Reproduce & Expected
DATATYPE-043 — Verify a TIME result column is decoded as a time of day at every declared precision -- TIME(0), TIME(3) and TIME(6) -- and that the driver reports the column's logical type as TIME rather than as a s…
Reproduce:
SELECT
CAST('09:15:00' AS TIME(0)) AS t0,
CAST('09:15:00.123' AS TIME(3)) AS t3,
CAST('09:15:00.123456' AS TIME(6)) AS t6,
CAST('23:59:59.999999' AS TIME(6)) AS end_of_day
SET TIME ZONE 'Asia/Tokyo'
SELECT
current_timezone() AS tz,
CAST('09:15:00.123456' AS TIME(6)) AS t6Expected (per the shared spec):
- result has exactly 1 row(s)
- result has 4 column(s)
- col
tz, row 0 == 'Asia/Tokyo' - full assertion contract:
result:
- label: default_session
row_count: 1
- label: default_session
column_count: 4
- label: default_session
time_of_day:
path: t0
clock: 09:15:00
- label: default_session
time_of_day:
path: t3
clock: '09:15:00.123'
- label: default_session
time_of_day:
path: t6
clock: '09:15:00.123456'
- label: default_session
time_of_day:
path: end_of_day
clock: '23:59:59.999999'
- label: default_session
column_logical_type:
column: t0
type_name: TIME
- label: default_session
column_logical_type:
column: t3
type_name: TIME
- label: default_session
column_logical_type:
column: t6
type_name: TIME
- label: default_session
column_logical_type:
column: end_of_day
type_name: TIME
- label: non_utc_session
column:
name: tz
equals: Asia/Tokyo
- label: non_utc_session
time_of_day:
path: t6
clock: '09:15:00.123456'
- label: non_utc_session
column_logical_type:
column: t6
type_name: TIMEDATATYPE-044 — Verify NULL handling for TIME, and that a TIME column's reported type survives a result that carries no TIME value at all.
Reproduce:
SELECT
CAST(NULL AS TIME(6)) AS null_time,
CAST('00:00:00' AS TIME(6)) AS midnight
SELECT CAST('09:15:00.123456' AS TIME(6)) AS t6
FROM (SELECT 1) AS one
WHERE 1 = 0Expected (per the shared spec):
- result has exactly 1 row(s)
- result has 2 column(s)
- col
null_time, row 0 is null - col
midnight, row 0 is not null - result has exactly 0 row(s)
- result has 1 column(s)
- full assertion contract:
result:
- label: null_and_midnight
row_count: 1
- label: null_and_midnight
column_count: 2
- label: null_and_midnight
column:
name: null_time
is_null: true
- label: null_and_midnight
column:
name: midnight
is_not_null: true
- label: null_and_midnight
time_of_day:
path: midnight
clock: 00:00:00
- label: null_and_midnight
column_logical_type:
column: null_time
type_name: TIME
- label: null_and_midnight
column_logical_type:
column: midnight
type_name: TIME
- label: empty
row_count: 0
- label: empty
column_count: 1
- label: empty
column_logical_type:
column: t6
type_name: TIMEContext
- The behavior was first fixed in a DIFFERENT driver — reference PR: Fix Arrow TIME results on Thrift and SEA databricks-sql-go#567 — which seeded the shared language-neutral spec. This issue tracks the same conformance gap in databricks/databricks-sql-python; the reference PR is for cross-referencing the intended behavior, NOT a change to this repo.
- Coverage PR carrying the reproducing xfail test(s): https://github.com/databricks/databricks-driver-test/pull/2321
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(thrift, kernel): report TIME logical type in cursor.description
atharva18-hue commentedon Dec 2, 2026
Hi! I'm working on a fix for this — adding TIME to the Thrift SqlName remap and the kernel type_mapping allow-list, and preserving the TIME logical type for NULL-only / zero-row results. I'll open a PR shortly. Thanks!