feat: view registration from inst/sql/
Seven DuckDB views register on session open: long (raw), spending_long and revenue_long (prefix-filtered, NOT is_aggregate per reader-spec §4), canonical_fips_xwalk and summary_categories (identity), spending_annotated and revenue_annotated (LEFT JOIN xwalk + categories for verb composition). File prefix `NN-` enforces creation order so *_annotated views resolve their *_long dependencies. Deviation from plan: series_breaks/cpi_annual/legacy_aggregate_map and *_with_transforms views are deferred — their backing parquets are not in the v0.1 corpus (manifest.files.metadata only lists canonical_fips_xwalk and summary_categories). The verbs will compute CPI adjustment verb-side against a bundled cpi table in a later task.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
CREATE OR REPLACE VIEW spending_annotated AS
|
||||
SELECT
|
||||
s.*,
|
||||
x.gov_name AS xwalk_gov_name,
|
||||
x.govs_type,
|
||||
x.type_label,
|
||||
x.fips_state AS xwalk_fips_state,
|
||||
x.fips_county AS xwalk_fips_county,
|
||||
x.fips_place,
|
||||
x.population_acs,
|
||||
c.category,
|
||||
c.category_type,
|
||||
c.spend_subtype
|
||||
FROM spending_long s
|
||||
LEFT JOIN canonical_fips_xwalk x USING (canonical_govid)
|
||||
LEFT JOIN summary_categories c USING (item_code);
|
||||
Reference in New Issue
Block a user