Session Log: 2026-06-23

📋 Session Overview

In this session, we resolved a major BigQuery compilation error in stg_quo_calls caused by a schema and data type mismatch on the participants column. This blocker arose during the UNION ALL combination of raw historical backfill tables and live webhook event stores.


🚀 Key Accomplishments

1. BigQuery UNION Type Mismatch Fix (stg_quo_calls)

  • The Issue: The historical backfill table stored call participants as a standard BigQuery string array (ARRAY<STRING>). However, the live webhook events (sourced from quo_raw_events and parsed on-the-fly) left the participants field as a raw un-cast JSON array, triggering a fatal type mismatch during compilation.
  • The Resolution: Refactored models/staging/quo/stg_quo_calls.sql to enforce explicit, matched casting:
    • Explicitly cast historical participants directly.
    • Cast live webhook payload elements into empty string arrays cast([] as array<string>) to perfectly align schemas before executing the UNION ALL.
  • Deduplication Architecture: Verified that our row_number() over (partition by call_id order by created_at desc) deduplication operates correctly, ensuring a single clean version of each call is compiled even if historical data overlaps with live webhooks.

📁 Files Created & Modified

  • models/staging/quo/stg_quo_calls.sql