{"record":{"id":"52d6400faec0c748","repo":"apache/seatunnel","slug":"failed-to-validate-bigquery-schema-coherence","errorCode":null,"errorMessage":"Failed to validate BigQuery schema coherence","messagePattern":"Failed to validate BigQuery schema coherence","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-bigquery/src/main/java/org/apache/seatunnel/connectors/bigquery/sink/BigQuerySaveModeHandler.java","lineNumber":140,"sourceCode":"                }\n            }\n            log.info(\n                    \"BigQuery schema coherence check passed successfully for table: {}\",\n                    tablePath.getFullName());\n        } catch (TableNotExistException e) {\n            log.info(\n                    \"Target BigQuery table '{}' does not exist yet. Skipping schema coherence check.\",\n                    tablePath.getFullName());\n            return;\n        } catch (Exception e) {\n            if (e instanceof CatalogException) {\n                throw (CatalogException) e;\n            }\n            if (e instanceof SeaTunnelRuntimeException) {\n                throw (SeaTunnelRuntimeException) e;\n            }\n            if (e instanceof BigQueryException) {\n                throw new CatalogException(\"Failed to validate BigQuery schema coherence\", e);\n            }\n            log.warn(\"Schema validation check ignored due to exception: {}\", e.getMessage());\n        }\n    }\n\n    private boolean isTypeCompatible(SqlType source, SqlType sink) {\n        if (source == sink) {\n            return true;\n        }\n        // Widening integer compatibility\n        if ((source == SqlType.TINYINT\n                        || source == SqlType.SMALLINT\n                        || source == SqlType.INT\n                        || source == SqlType.BIGINT)\n                && (sink == SqlType.BIGINT)) {\n            return true;\n        }\n        // Widening float compatibility","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-bigquery/src/main/java/org/apache/seatunnel/connectors/bigquery/sink/BigQuerySaveModeHandler.java#L122-L158","documentation":"Thrown by BigQuerySaveModeHandler.validateSchemaCoherence when the schema validation itself throws a BigQueryException (e.g. failure fetching the remote table schema via BigQuery API) that is neither CatalogException nor SeaTunnelRuntimeException. It wraps the API failure while preserving the cause. Notably, other unexpected exceptions are only logged as a warning and skipped — only BigQueryException fails the job with this message.","triggerScenarios":"During handleSchemaSaveMode, when retrieving the remote BigQuery table schema (get remote table) fails due to a BigQueryException: table lookup rejected, permission denied on metadata, quota/network errors, or invalid dataset/table identifiers.","commonSituations":"Transient BigQuery API outage or rate limit while validating schema at job start; service account lacking bigquery.tables.get; table deleted between existence check and schema read; malformed table path.","solutions":["Inspect the wrapped BigQueryException cause for the specific API error (403, 404, 429, 5xx)","Verify the service account can read table metadata (bigquery.tables.get, metadataViewer)","Retry the job if the cause was a transient quota/network error","Confirm table_path resolves to an existing table before save-mode validation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!catalog.tableExists(tablePath)) {\n    throw new IllegalStateException(\"BigQuery table \" + tablePath.getFullName() + \" missing before schema validation\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    handler.handleSchemaSaveMode();\n} catch (CatalogException e) {\n    if (e.getCause() instanceof BigQueryException bqe && bqe.getCode() == 429) {\n        // transient quota error: backoff and retry the job/validation\n    } else {\n        throw e;\n    }\n}","preventionTips":["Ensure the service account has bigquery.tables.get (metadata read) on the dataset","Retry jobs on transient 429/5xx API errors during startup","Confirm the table is not deleted concurrently between check and validation","Validate table_path format (project.dataset.table) before submitting"],"tags":["bigquery","schema-validation","save-mode","api-error"],"backgroundTag":"schema-validation-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}