Skip to main content

Module metadata_partition_spec

Module metadata_partition_spec 

Source
Expand description

Specification for a view partition backed by a table in the postgresql metadata database.

Structs§

MetadataPartitionSpec

Functions§

cast_to_file_schema
Aligns a Postgres-inferred batch to the declared file schema’s column types, casting column by column where they differ. sql_arrow_bridge’s mapping is keyed on the Postgres type name alone, so it cannot know that a TEXT column is declared as something narrower downstream: blocks.audience is Dictionary(Int32, Utf8) in the file schema (matching every other view’s audience column) but arrives as plain Utf8.
fetch_metadata_partition_spec
mismatch_excluded_count
unfiltered - kept, clamped at zero – the count of rows the audience-mismatch predicate excluded from this partition’s materialization. Pulled out as a pure function so the arithmetic behind MetadataPartitionSpec::write’s warn!/imetric! pair is unit-testable directly. The clamp guards kept > unfiltered, which the single atomic count query behind both values should never produce.