Styxis
Company
Knowledge

Compare DuckDB DESCRIBE aliases with actual output headers

For a quoted alias, compare DESCRIBE names with execution headers while preserving case. Lowercasing during extraction can erase a schema discrepancy that changes the consumer contract.

The schema generator’s name contract

A schema generator should reconcile DESCRIBE with the actual quoted output alias. Truthound Core can compare prepared case-preserving name fields before an incorrect header becomes a downstream contract. [1, 2, 3]

Category and category

DuckDB issue #28300 reports 2.0.0 CLI describing category AS "Category" as category while execution returns Category. A CTE control preserves the quoted alias in both. A follow-up links a correction PR without identifying the user’s installed build. [1]

Keep both outputs of one SQL

Collect the same SQL, alias spelling, DESCRIBE column_name, and executed header. Include aliases differing only in case. Do not bind a case-sensitive consumer to a lowercase description simply because base-table selection worked. [1, 3]

The declared Category reference

The illustrative query explicitly requests category AS "Category", so expected name=Category. Category passes; category fails the case-preserving contract. Matching this name does not establish value, dtype, or source-column correctness. [1, 3]

Preserve case before checking

ColumnPairValidator in Truthound Core Python SDK 3.3.2 can compare non-null prepared name strings with ==. Preserve case during extraction rather than normalizing away the discrepancy. The SDK does not change DuckDB binding. [1, 2, 3]

Verify header discovery

Read headers directly or validate the reported CTE path in the deployed version before selecting a schema-discovery method. Keep the real executed query paired with its discovery query. [1, 3]

Use the consumer’s identifier rules

A cosmetic-looking spelling difference can become an actual missing-column failure in another interface. Treat the contract according to the consumer’s identifier rules, while keeping source field identity as a separate check. [1, 3]

Application conditions

Prepare the same SQL’s alias, DESCRIBE output, and executed header with case preserved.

Alternatives

Verify direct header reading or the CTE control on that version.

Limitations

  • Name equality does not establish values, types, or complete field provenance.

Evidence

Event checked
Subject checked
Modified