Skip to content

feat: normalize and bundle reference vocabulary, add in-database load… - #4

Merged
gowthamrao merged 4 commits into
developfrom
feature/normalized-reference-vocab
Oct 7, 2026
Merged

gowthamrao merged 4 commits into
developfrom
feature/normalized-reference-vocab

Conversation

@gowthamrao

Copy link
Copy Markdown
Collaborator

…er, and modernize SQL

  • Normalize 3.51M-row lookup tables by decoupling repeated string columns from relational join keys, compressing total package assets to ~42.6 MB gzipped across 7 tables (cab_visit_hierarchy, cab_chronic_conditions, cab_device, cab_procedure, cab_meas_obs_test, cab_drug_ing_form, and unified cab_concept_names).
  • Add exported Taxis::loadReferenceTables() R function for automatic database ingestion with schema creation, skip guards (overwrite = FALSE), streaming insertions via DatabaseConnector::insertTable, indexing, and legacy cab_vocab_all_* compatibility views.
  • Modernize concept_ab_batch.sql and concept_ab_finalize.sql to directly query normalized integer tables and resolve names through cab_concept_names.
  • Add pre-flight legacy schema adapter in R/RunMining.R for automatic compatibility when running against un-normalized v57 databases.
  • Incorporate Supervisor Agent Astra recommendations (REV-084): retain custom CCSR procedures (130000000 series), preserve numeric fractional RVUs, retain 20-row visit hierarchy including level 9, and bundle pre-computed drug crosswalk as verified default.
  • Add testthat unit tests validating manifest integrity and package exports. All 63 tests pass; R CMD check passes cleanly with Status: OK.

gowthamrao and others added 4 commits October 5, 2026 11:24
…er, and modernize SQL

- Normalize 3.51M-row lookup tables by decoupling repeated string columns from relational join keys, compressing total package assets to ~42.6 MB gzipped across 7 tables (cab_visit_hierarchy, cab_chronic_conditions, cab_device, cab_procedure, cab_meas_obs_test, cab_drug_ing_form, and unified cab_concept_names).
- Add exported Taxis::loadReferenceTables() R function for automatic database ingestion with schema creation, skip guards (overwrite = FALSE), streaming insertions via DatabaseConnector::insertTable, indexing, and legacy cab_vocab_all_* compatibility views.
- Modernize concept_ab_batch.sql and concept_ab_finalize.sql to directly query normalized integer tables and resolve names through cab_concept_names.
- Add pre-flight legacy schema adapter in R/RunMining.R for automatic compatibility when running against un-normalized v57 databases.
- Incorporate Supervisor Agent Astra recommendations (REV-084): retain custom CCSR procedures (130000000 series), preserve numeric fractional RVUs, retain 20-row visit hierarchy including level 9, and bundle pre-computed drug crosswalk as verified default.
- Add testthat unit tests validating manifest integrity and package exports. All 63 tests pass; R CMD check passes cleanly with Status: OK.
…cks compatibility

SqlRender translates CREATE TABLE to CREATE TABLE ... USING DELTA AS SELECT CAST(NULL AS ...) on Spark/Databricks. An inline comment with a semicolon on the lag_bucket column definition caused SqlRender to misparse the comment as a column ('CAST(NULL AS delta/10) AS --,'), dropping the subsequent n_events column and triggering a ParseException in Spark.
…ab' into feature/normalized-reference-vocab
@jshoughtaling

jshoughtaling commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

@gowthamrao - I was able to run this branch end-to-end against a Databricks instance, with only a few minor hiccups (now resolved, apologies for the commit gore). Specifically:

  • A stray inline comment killed the DDL execution
  • Not having the CONCEPT table in my reference schema killed the batch script

Besides that, the reference upload to Databricks was a bit slow (>1 hour), which is expected, but it ultimately worked without issue.
Thanks for your help getting this all working!

@gowthamrao

Copy link
Copy Markdown
Collaborator Author

Thats great! merging this

@gowthamrao
gowthamrao merged commit 73340f6 into develop Oct 7, 2026
6 of 9 checks passed
@gowthamrao gowthamrao mentioned this pull request Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants