Skip to content

feat: Implement automatic schema upgrades for BigQuery logger - #1378

Draft
vasilyl wants to merge 3 commits into
google:mainfrom
vasilyl:auto-schema-upgrade
Draft

feat: Implement automatic schema upgrades for BigQuery logger#1378
vasilyl wants to merge 3 commits into
google:mainfrom
vasilyl:auto-schema-upgrade

Conversation

@vasilyl

@vasilyl vasilyl commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

  • Closes: N/A

2. Or, if no issue exists, describe the change:

Problem:
As the Go ADK analytics plugin updates its schema over time, users with pre-existing BigQuery tables will experience insertion errors due to missing columns, unless they manually migrate or recreate their tables.

Solution:
Implement automatic schema upgrades on initialization. During NewBigQueryAgentAnalyticsPluginWithClients, the plugin retrieves the existing table metadata, compares its schema against the latest EventsSchema(), and automatically updates the BigQuery table schema to add any missing fields or record sub-fields safely.

Testing Plan

  • TestSchemaFieldsMatch validates that the schema comparison algorithm correctly identifies top-level and nested structural differences.
  • TestNewBigQueryAgentAnalyticsPlugin_TableExists verifies that existing tables are inspected and dynamically updated without throwing insertion errors.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.

@vasilyl
vasilyl force-pushed the auto-schema-upgrade branch from a62ed31 to 9461b78 Compare August 25, 2026 19:48
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.

1 participant