[coverage] Conformance findings: PARAMQUERY-022
还没有人认领这个 Issue。
评估
调研方向
从 DecimalParameter._cast_expr 开始,检查 issue 中描述的 CAST_EXPR.format 调用。使用 coverage PR 的 tests/ diff 定位 test_decimal_target_carries_declared_precision_and_scale,然后运行该测试;完成的标准是 SELECT ? AS v 保留声明的 DECIMAL(10,2) 形状,并且预期的 123.45 Decimal128 结果通过。
由索引模型根据 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
- PARAMQUERY-022 [thrift]: DecimalParameter._cast_expr formats the DECIMAL cast with its arguments transposed — CAST_EXPR.format(self.scale, self.precision) — so a declared precision=10/scale=2 target emits DECIMAL(2,10) (scale greater than precision, invalid) instead of DECIMAL(10,2), losing the declared decimal shape on the wire
- failing test:
test_decimal_target_carries_declared_precision_and_scale(see the coverage PR diff undertests/)
- failing test:
Reproduce & Expected
PARAMQUERY-022 — Verify a DECIMAL/NUMERIC target with a declared precision and scale sends the parameter as a DECIMAL carrying THAT precision/scale, so the bare-marker result column is a decimal of the declared shape and the fractional digits survive.
Reproduce:
SELECT ? AS v
Expected (per the shared spec):
- result has exactly 1 row(s)
- col 0, row 0 == '123.45' (type Decimal128)
- full assertion contract:
result:
- row_count: 1
- column:
index: 0
row: 0
type: Decimal128
equals: '123.45'
- result_column_type_matches_target: true
Context
- The behavior was first fixed in a DIFFERENT driver — reference PR: https://github.com/databricks/databricks-odbc/pull/167 — 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/1061
- 主要语言
- Python
- 星标
- 233
- 派生
- 152
- 平均合并
- 21 小时 5 分钟
- 30 天内合并 PR
- 10
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
databricks/databricks-sql-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
engineer-bot
难度 2/5 1-3 小时 新手友好度 76/100
databricks/databricks-sql-python#860 · 3 条评论 ·
查看 databricks/databricks-sql-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 86/100
-
🐛 Bug 🔔 Pending processing
难度 2/5 1-3 小时 新手友好度 84/100
jumpserver/jumpserver#17584 ·