Styxis
Company
Knowledge

Keep a target type for all-NULL Parquet struct children in DuckDB

Establish cast completion before checking the returned type and NULL positions of a NULL-only struct child. An invalidated connection is not a successfully typed missing-value result.

Missingness does not erase type

An all-NULL nested field still has a requested target type. Check the cast path pushed into the scan separately from value missingness. Truthound Core can inspect an actually returned column’s dtype after the engine finishes successfully. [1, 2, 3]

An error is not an output row

DuckDB issue #28183 reports a VARCHAR cast of a NULL-typed Parquet struct child producing INTERNAL Error and invalidating the database in 2.0. A follow-up gives comparison-filter examples without a cast. Those reports do not turn an exception into an actual output row. [1]

Record connection health too

Read NULL-only and real-string child controls. Record target dtype, output schema, NULL positions, and whether the connection can execute a subsequent query. Preserve the original failure before evaluating TRY_CAST or an explicit-schema path. [1, 3]

NULL type versus NULL cells

Declare the cast target VARCHAR. A returned VARCHAR column passes the dtype condition even when every value is NULL. A hypothetical returned dtype NULL fails; here NULL names a type, not a missing cell. Do not fabricate that output when the actual engine instead throws. [1, 3]

Map returned dtype deliberately

ColumnTypeValidator in Truthound Core Python SDK 3.3.2 checks the returned column against expected_types. If the column is materialized in Polars, define the mapping from engine VARCHAR to its supported string dtype. The SDK cannot repair an invalidated DuckDB connection. [1, 2, 3]

Suppression is incomplete evidence

Compare TRY_CAST and explicit-schema alternatives on the actual environment, retaining failed sessions separately. Suppressing an exception does not establish preserved values or a usable connection. [1, 3]

Check execution before schema

A useful completion record reports execution status before schema status. Otherwise a pipeline can accidentally count an unexecuted or failed cast as a correctly typed set of missing observations. [1, 3]

Application conditions

Collect actual returned columns, NULL positions, and connection state after execution.

Alternatives

Compare TRY_CAST and explicit schemas in the actual environment, retaining failed sessions.

Limitations

  • Do not invent a dtype result row for an execution that throws.

Evidence

Event checked
Subject checked
Modified