Expand description
Target-type resolver (ADR-0014 L4, roadmap §16).
Given a column’s canonical RivetType and a runtime-chosen
ExportTarget, resolve what the column becomes in a downstream
warehouse: the native target type (full fidelity), the autoload
type a generic Parquet reader infers without a declared schema, a safety
TargetStatus, a note, and an optional materialization (cast_sql /
load-schema hint).
Design (locked in the type-support architecture review):
- Dispatch on
RivetType, never the physical Arrow type. The previousbq_compatmatched onarrow::DataTypeand so was blind tojson/uuid/enum(allUtf8/FixedSizeBinaryby then) and hard-failed UUID. The resolver keys off the semantic type; Arrow is consulted only for decimal precision (andRivetType::Decimalalready carriesp,s). - Total & infallible. Every
(RivetType, ExportTarget)pair yields a populatedTargetColumnSpec; an unmappable column is astatus: Failrow, never anErr. This keeps the type-report table and--jsonshape stable. autoload_typetells the truth. It encodes the empirically verified behavior of each target’s Parquet autoloader — notably that BigQuery autoload degrades ParquetJsonType/UUIDTypetoBYTES,isAdjustedToUTC=falsetimestamps toTIMESTAMP(notDATETIME), and 3-level lists toREPEATED RECORD{item}. DuckDB honors all of them.
BigQuery numeric limits (as of 2025): NUMERIC — precision 1–29, scale 0–9 BIGNUMERIC — precision 1–76, scale 0–38
Structs§
- Target
Column Spec - One column’s per-target materialization spec (ADR-0014 L4). Uniform across
targets so the type-report table and
--jsonstay stable; an unmappable column is astatus: Failrow, not an error. - Target
Input - The borrowed subset a resolver is allowed to read. Built from a
TypeMappingviaFrom. Dispatch is onrivet_type;arrow_typeis retained for callers that want it but the resolver reads precision fromRivetType::Decimaldirectly.
Enums§
- Export
Target - A supported downstream warehouse target. Closed, in-tree, contract-tested
set; chosen at runtime from
--target X, one per run. - Target
Status - Status of a column’s resolution against a specific target.