<@U04S8PLJWMT> I've bigquery destination 2.9.2 and...
# ask-ai
f
@kapa.ai I've bigquery destination 2.9.2 and today I found a record with all fields set to null, when the source has primary key not null. How can it be possible? Is this a known issue?
k
There are several possible reasons why you might see a record with all fields set to null in your BigQuery destination, even when the source primary key is not null. Based on the knowledge sources: 1. Schema or Data Mapping Issues: If the schema mapping between source and destination is not configured correctly, or if there are issues with how object fields are handled, you may see nulls in the destination. For example, when syncing from MongoDB to BigQuery, object fields can come up as null if Airbyte does not map them properly, or if the mapping expects a string but receives an object instead. Reviewing the data type mapping and ensuring compatibility is important. Logs may provide more details in such cases [Source MongoDB - objects coming up as null in bigquery destination](https://discuss.airbyte.io/t/3443). 2. User-Defined Schema Issues: In the case of S3 as a source, a user-defined schema that only specifies a subset of columns can result in records with mostly null values. Assigning the schema to all columns resolved the issue for one user [Source S3 - One row of mostly nulled data](https://discuss.airbyte.io/t/2563). 3. Normalization or Validation Errors: Sometimes, normalization steps or JSON schema validation can fail, resulting in nulls. For example, if the data does not match the expected object structure, you may see errors like "null found, object expected," and the resulting records may be null [Normalization error: null found, object expected](https://discuss.airbyte.io/t/806). 4. Primary Key or Deduplication Issues: If the primary key is not set correctly or if deduplication logic fails, Airbyte may emit a row with all nulls. This can also happen if the primary key is misconfigured in the UI or API, as seen in some DynamoDB to BigQuery syncs [Destination BigQuery: DynamoDB -> BigQuery: Only top-level primary keys are supported](https://github.com/airbytehq/airbyte/issues/30250). 5. Connector or Platform Bugs: There are known issues where certain connector versions or platform mismatches can cause sync failures or unexpected nulls. For example, using a connector version that requires a newer platform version can result in config errors and failed syncs, though this typically results in a failed job rather than null records [destination-bigquery syncs fail when GCP project-Ids contain special characters, starting with 2.9.0](https://github.com/airbytehq/airbyte/issues/48732). Summary: Yes, records with all fields set to null can occur due to schema mapping issues, user-defined schema misconfiguration, normalization/validation errors, or primary key/deduplication problems. These are known issues in some scenarios. Reviewing your sync logs and schema configuration is recommended to pinpoint the exact cause in your case. If the problem persists, consider sharing logs or more details with the Airbyte community for further troubleshooting.
f
@kapa.ai what can I seach in logs for this problem?
k
A message from kapa.ai
To investigate why a record with all fields set to null appeared in your BigQuery destination, you should search your Airbyte logs for the following keywords and patterns, as suggested by the knowledge sources: - "schema validation failed" This message often appears when the data does not match the expected schema, which can result in nulls being written to the destination. Look for lines like:
Copy code
JSON schema validation failed.   errors: $: null found, object expected
or
Copy code
Record schema validation failed. Errors: json schema validation failed when comparing the data to the json schema.
- "null found" This phrase is commonly included in error messages when a field is expected to have a value but is null. For example:
Copy code
$.field_name: null found, string expected
- "Validation failed" This is a higher-level error that may indicate a problem during normalization or data loading:
Copy code
Validation failed: null
- "object expected" This can indicate that an object was expected in the schema, but a null or other type was found. - "Final state message is accepted" This message can help you correlate the end of a sync job with the errors above, to see if the job completed despite validation issues. - "Array cannot have a null element" If your schema includes arrays, this error can also result in null records being written. These log messages have been reported in several cases where null records appeared in BigQuery, even when the source had valid data and primary keys were not null. Searching for these terms should help you identify the root cause in your logs and provide more context for troubleshooting the issue further. If you find such messages, reviewing the surrounding log lines can help pinpoint which stream or field is causing the problem<sup>[Normalization error: null found, object expected](https://discuss.airbyte.io/t/806)</sup><sup>[Postgres Failure to Sync](https://discuss.airbyte.io/t/1208)</sup>.
f
@kapa.ai can I set source connector Debezium on Airbyte as
include.unchanged.fields=true
?
k
A message from kapa.ai
I'm sorry, but the knowledge sources provided do not contain any information about setting the Debezium property
include.unchanged.fields=true
in Airbyte source connectors. There is no mention of this configuration option or instructions on how to set it within Airbyte's UI or connector settings. If you need this specific functionality, you may need to consult the official Airbyte or Debezium documentation, or reach out to the Airbyte community for further guidance.
f
@kapa.ai can you please help me writing a retrospective for this kind of error to be reported to my team?
k
A message from kapa.ai
Certainly! Here’s a sample retrospective report you can share with your team, based on the types of issues and troubleshooting steps found in the knowledge sources: --- ## Retrospective: Null Records in BigQuery Destination ### Summary During a recent sync using Airbyte with BigQuery destination (v2.9.2), we observed records where all fields were set to
null
, despite the source having a non-null primary key. This issue can lead to data quality concerns and downstream processing errors. ### What Happened - A sync job completed successfully, but inspection of the destination table revealed at least one record with all fields as
null
. - The source data for the affected record(s) had a valid, non-null primary key. ### Investigation & Findings - Schema Validation Issues: Airbyte logs indicated schema validation errors such as
null found, object expected
or
Record schema validation failed
. These errors suggest a mismatch between the source data and the expected schema in BigQuery, which can result in null records being written to the destination. This has been observed in other Airbyte user reports as well [Normalization error: null found, object expected](https://discuss.airbyte.io/t/806), [Postgres Failure to Sync](https://discuss.airbyte.io/t/1208). - User-Defined Schema Problems: In some cases, incomplete or incorrect user-defined schemas (e.g., only specifying a subset of columns) have led to records with mostly null values [Source S3 - One row of mostly nulled data](https://discuss.airbyte.io/t/2563). - Object Mapping Issues: For sources like MongoDB, object fields may appear as null in BigQuery if the mapping is not handled properly [Source MongoDB - objects coming up as null in bigquery destination](https://discuss.airbyte.io/t/3443). - Primary Key or Deduplication Issues: Misconfiguration of primary keys or deduplication logic can also result in null records. ### What Went Well - The issue was detected promptly through data validation in the destination. - Airbyte logs provided useful error messages that helped narrow down the root cause. ### What Didn’t Go Well - The sync job status was "Success" despite the presence of null records, which could lead to undetected data quality issues. - Schema mismatches or mapping issues were not flagged during configuration, only at runtime. ### Action Items 1. Improve Schema Validation: Review and validate source and destination schemas before running syncs. Ensure all expected fields are mapped and data types are compatible. 2. Enhance Monitoring: Set up automated checks to detect and alert on records with all-null fields in the destination. 3. Review Connector Configurations: Double-check user-defined schemas and primary key settings for all connections. 4. Log Review: Regularly search Airbyte logs for keywords such as
schema validation failed
,
null found
, and
object expected
to catch issues early. 5. Documentation: Update internal runbooks to include troubleshooting steps for schema and mapping issues. ### References - See Airbyte community discussions and issue reports for similar cases and troubleshooting steps. --- If you need a more tailored report or want to include specific log excerpts, let me know!