[coverage] Conformance findings: DATATYPE-042

未关闭
#902 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
58/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
python, sql
领域
database

调研方向

从 tests/ 下的 coverage PR diff 和名为 test_untyped_null_column_reports_string_type 的失败测试开始,然后追踪 cursor.description 如何为有数据的结果和空结果推导 schema 类型。验证 SELECT NULL 和 CAST(NULL AS STRING) 在两条路径中都报告相同的 STRING 类型,同时保留已说明的行、列、名称和 null 值断言。

由索引模型根据 Issue 内容生成。

描述

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-042 [sea]: Over the Rust kernel (SEA), an untyped NULL column (SELECT NULL, SQL VOID) reports cursor.description type_code 'null' instead of the connector's STRING type, while its CAST(NULL AS STRING) sibling in the same result set reports 'string' — self-inconsistent and divergent from the Thrift path; affects both the live-data and empty-result schema paths
    • failing test: test_untyped_null_column_reports_string_type (see the coverage PR diff under tests/)
  • DATATYPE-042: Over the Rust kernel (SEA), an untyped NULL column (SELECT NULL, SQL VOID) passes the wire type through and reports cursor.description type_code 'null' instead of the connector's STRING type, while a CAST(NULL AS STRING) sibling in the same result set reports 'string' — self-inconsistent, and divergent from the Thrift path which reports 'string'; affects both the live-data (Arrow-batch-derived) and empty-result (manifest-derived) schema paths

Reproduce & Expected

DATATYPE-042 — Verify that an UNTYPED NULL column -- SELECT NULL (SQL type VOID) -- reports the driver's STRING type on the result-set schema, identically to a CAST(NULL AS STRING) sibling selected by the SAME…

Reproduce:

SELECT NULL AS untyped_null, CAST(NULL AS STRING) AS typed_null_string
SELECT NULL AS untyped_null, CAST(NULL AS STRING) AS typed_null_string
FROM range(1) WHERE 1 = 0

Expected (per the shared spec):

  • result has exactly 1 row(s)
  • result has 2 column(s)
  • col 0 is named untyped_null
  • col 1 is named typed_null_string
  • col untyped_null, row 0 is null
  • col typed_null_string, row 0 is null
  • result has exactly 0 row(s)
  • result has 2 column(s)
  • col 0 is named untyped_null
  • col 1 is named typed_null_string
  • full assertion contract:
result:
- label: live_row
  row_count: 1
- label: live_row
  column_count: 2
- label: live_row
  column:
    index: 0
    name: untyped_null
- label: live_row
  column:
    index: 1
    name: typed_null_string
- label: live_row
  column:
    name: untyped_null
    is_null: true
- label: live_row
  column:
    name: typed_null_string
    is_null: true
- label: live_row
  untyped_null_reports_string_type:
    columns:
    - untyped_null
    - typed_null_string
    match_each_other: true
- label: empty_result
  row_count: 0
- label: empty_result
  column_count: 2
- label: empty_result
  column:
    index: 0
    name: untyped_null
- label: empty_result
  column:
    index: 1
    name: typed_null_string
- label: empty_result
  untyped_null_reports_string_type:
    columns:
    - untyped_null
    - typed_null_string
    match_each_other: true

Context

主要语言
Python
星标
233
派生
152
平均合并
21 小时 5 分钟
30 天内合并 PR
10

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

databricks/databricks-sql-python 的其他 Issue

查看 databricks/databricks-sql-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。