Enabling static analysis of SQL queries at Meta
Nov 30, 2022Daniel Ohayon

Summary
This post introduces UPM (Unified Programming Model), a standalone library for static analysis of SQL code and enhancement of SQL authoring. UPM represents SQL queries as semantic trees, enabling tools to perform static analysis (linters, data lineage), query rewriting, or act as a pluggable SQL front-end for query engines. It addresses challenges with embedded query engine analysis logic and limited type systems by providing a unified SQL dialect and enhanced type-checking using user-defined types. UPM-powered tools can now build column-level data lineage graphs across the warehouse.