Skip to content

[coverage] Conformance findings: DATATYPE-043 #500

Open

Description

@peco-engineer-bot

Summary

Surfaced by the multi-language coverage fan-out while conformance-testing these SPEC-IDs against databricks/databricks-sql-go. 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-go) is fixed, then flips green as a tripwire.

Findings

  • DATATYPE-043 [thrift, sea]: Result metadata reports no DECIMAL precision/scale: the rows type does not implement driver.RowsColumnTypeDecimalSize, so sql.ColumnType.DecimalSize() returns ok=false for DECIMAL(10,2)/(38,0)/(38,38) on both the with-rows and schema-only paths, losing the declared qualifiers for every metadata consumer while the value stays correct
    • failing test: TestDecimalPrecisionAndScaleInResultMetadata (see the coverage PR diff under tests/)

Reproduce & Expected

DATATYPE-043 — Verify the driver's RESULT-SET METADATA reports a DECIMAL column's DECLARED precision and scale -- for a result that has rows AND for a schema-only (zero-row) result, and including the scale-0 case.

Reproduce:

SELECT
  CAST(3.5 AS DECIMAL(10, 2))  AS amount,
  CAST(1 AS DECIMAL(38, 0))    AS whole,
  CAST(0.1 AS DECIMAL(38, 38)) AS all_fraction
SELECT
  CAST(3.5 AS DECIMAL(10, 2))  AS amount,
  CAST(1 AS DECIMAL(38, 0))    AS whole,
  CAST(0.1 AS DECIMAL(38, 38)) AS all_fraction
WHERE 1 = 0

Expected (per the shared spec):

  • result has exactly 1 row(s)
  • col amount, row 0 == 3.5
  • result has exactly 0 row(s)
  • full assertion contract:
result:
- label: with_rows
  row_count: 1
- label: with_rows
  decimal_type_qualifiers:
    column: amount
    precision: 10
    scale: 2
- label: with_rows
  decimal_type_qualifiers:
    column: whole
    precision: 38
    scale: 0
- label: with_rows
  decimal_type_qualifiers:
    column: all_fraction
    precision: 38
    scale: 38
- label: with_rows
  column:
    name: amount
    equals: 3.5
- label: schema_only
  row_count: 0
- label: schema_only
  decimal_type_qualifiers:
    column: amount
    precision: 10
    scale: 2
- label: schema_only
  decimal_type_qualifiers:
    column: whole
    precision: 38
    scale: 0
- label: schema_only
  decimal_type_qualifiers:
    column: all_fraction
    precision: 38
    scale: 38

Context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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