Skip to main content

Module log_stats_view

Module log_stats_view 

Source
Expand description

SQL-based view for log statistics aggregated by process, minute, level, and target

Functions§

log_stats_ddl_text
Assembles log_stats_view_definition()’s equivalent CREATE MATERIALIZED VIEW log_stats WITH (...) DDL text, for the migration seed’s definition_sql column (kept for display and audit only – never re-parsed). Each query is wrapped in $$...$$; none of them contains a $$, so no quote-escaping helper is needed.
log_stats_view_definition
log_stats’s definition, expressed as a ViewDefinition – the single source of truth shared by the migration seed (migration.rs’s upgrade_v9_to_v10), the parser round-trip test, and make_log_stats_view below. log_stats is a SqlBatchView whose only distinction from a DDL-defined view is that its SQL lives in Rust rather than in a lakehouse_view_set_definitions row – this function is what lets the migration seed that row.
make_log_stats_view
Creates a new SqlBatchView for log statistics aggregated by process, minute, level, and target – build_sql_batch_view over log_stats_view_definition, so log_stats is built through the exact same path a DDL-defined view is.