#21217·bytebase

BigQuery schema sync fails when ORDINAL_POSITION is NULL

Author: mangareaderCreated Aug 21, 2026Updated Aug 24, 2026

Provide the Bytebase version you are using

3.21.1

Describe the bug

Bytebase fails to sync the database schema from Google BigQuery when ORDINAL_POSITION returned by BigQuery metadata is NULL.

The schema sync fails completely with the following error:

failed to sync database schema for database "xxx": bigquery: NULL cannot be assigned to field OrdinalPosition of type int32

It looks like the BigQuery schema introspection code expects OrdinalPosition to always be a non-null int32, while BigQuery can return NULL for this field for some metadata entries.

Steps to reproduce

1/ Add a Google BigQuery instance to Bytebase. 2/ Connect to a project containing the xx dataset/database. 3/ Trigger Sync database schema. 4/ Bytebase starts querying the BigQuery metadata. 5/ Schema synchronization fails when BigQuery returns a NULL value for ORDINAL_POSITION.

Expected behavior

Bytebase should successfully synchronize the BigQuery schema even when ORDINAL_POSITION is NULL.

A nullable ordinal position returned by BigQuery metadata should not cause the entire database schema sync to fail.

Provide the database you are using

No response

Additional context

No response