Nesting from rest api to bigquery does not appear ...
# replication-ask-ai
s
Nesting from rest api to bigquery does not appear to be working correctly. Arrays are saved as JSON blobs instead of separate tables.
k
Airbyte's Basic Normalization feature attempts to expand any nested arrays or objects it receives into separate tables to allow more ergonomic querying of your data. For example, if the source provides data in the following format:
Copy code
json {    "make": "alfa romeo",    "model": "4C coupe",    "limited_editions": [    { "name": "4C spider", "release_year": 2013 },    { "name" : "4C spider italia" , "release_year": 2018 }    ]   }
The resulting normalized schema would be:
Copy code
sql CREATE TABLE "cars" (    "_airbyte_cars_hashid" VARCHAR,    "_airbyte_emitted_at" TIMESTAMP_WITH_TIMEZONE,    "_airbyte_normalized_at" TIMESTAMP_WITH_TIMEZONE,    "make" VARCHAR,    "model" VARCHAR   );      CREATE TABLE "limited_editions" (    "_airbyte_limited_editions_hashid" VARCHAR,    "_airbyte_cars_foreign_hashid" VARCHAR,    "_airbyte_emitted_at" TIMESTAMP_WITH_TIMEZONE,    "_airbyte_normalized_at" TIMESTAMP_WITH_TIMEZONE,    "name" VARCHAR,    "release_year" VARCHAR   );
If the nested items in the array are not objects then they are expanded into a string field of comma-separated values. However, if you're experiencing issues with arrays being saved as JSON blobs instead of separate tables, it might be due to a bug in the version of Airbyte you're using. There have been several bug fixes related to array processing in the BigQuery Denormalized destination, as seen in the [changelog](https://docs.airbyte.com/integrations/destinations/bigquery-denormalized). Please ensure you're using the latest version of Airbyte and the BigQuery Denormalized destination. If the issue persists, consider raising an issue on the [Airbyte GitHub](https://github.com/airbytehq/airbyte/issues) page. Sources: - [Basic Normalization](https://docs.airbyte.com/understanding-airbyte/basic-normalization/) - [BigQuery Denormalized Changelog](https://docs.airbyte.com/integrations/destinations/bigquery-denormalized)