You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SCD table in BigQuery should have array values from postgres table populated instead of null.
Current Behavior
The SCD table in BigQuery has null populated for array values. The _airbyte_raw_table has the array values transferred from postgres correctly. But the transformation from _airbyte_raw_table to table_scd populates null in the array field. Thanks to the help from @marcosmarxm on slack, we were able to find the root cause of the issue to be the usage of the legacy JSON function - json_extract_scalar in the DBT model for the SCD in BigQuery. The json_query or json_query_array should be used based on if the destination column needs to be string or array type as per this Google docs.
Create a test table in postgres with create table array_test (id bigserial primary key, values text[] not null, created_at timestamptz not null DEFAULT (NOW() AT TIME ZONE 'utc'));
Insert some data - insert into array_test(values) values('{"a","b","c"}');
Configure a CDC from postgres to BigQuery
Run the Sync
Look at data in SCD tables. The data {"a", "c", "c"} is missing. (the data is present in _raw_airbyte_array_test)
Expected Behavior
The SCD table in BigQuery should have array values from postgres table populated instead of null.
Current Behavior
The SCD table in BigQuery has null populated for array values. The _airbyte_raw_table has the array values transferred from postgres correctly. But the transformation from _airbyte_raw_table to table_scd populates null in the array field. Thanks to the help from @marcosmarxm on slack, we were able to find the root cause of the issue to be the usage of the legacy JSON function -
json_extract_scalar
in the DBT model for the SCD in BigQuery. Thejson_query
orjson_query_array
should be used based on if the destination column needs to bestring
orarray
type as per this Google docs.Logs
Steps to Reproduce
create table array_test (id bigserial primary key, values text[] not null, created_at timestamptz not null DEFAULT (NOW() AT TIME ZONE 'utc'));
{"a", "c", "c"}
is missing. (the data is present in _raw_airbyte_array_test)Severity of the bug for you
High
Airbyte Version
0.25.0-alpha
Connector Version (if applicable)
Destination (bigquery): 0.3.6
Source (postgres): 0.3.4
Additional context
n/a
The text was updated successfully, but these errors were encountered: