{"record":{"id":"bdcb4a6c2554d7e2","repo":"apache/seatunnel","slug":"table-not-found","errorCode":"TABLE_NOT_FOUND","errorMessage":"BigQuery target table does not exist: %s.%s.%s. Please create the target table before starting the sink.","messagePattern":"BigQuery target table does not exist: (.+?)\\.(.+?)\\.(.+?)\\. Please create the target table before starting the sink\\.","errorType":"error_code","errorClass":"BigQueryConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-bigquery/src/main/java/org/apache/seatunnel/connectors/bigquery/sink/writer/TableSchemaUtil.java","lineNumber":98,"sourceCode":"                    .build();\n        } catch (Descriptors.DescriptorValidationException | IOException e) {\n            throw new BigQueryConnectorException(\n                    BigQueryConnectorErrorCode.WRITER_CREATE_FAILED, e);\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            throw new BigQueryConnectorException(\n                    BigQueryConnectorErrorCode.WRITER_CREATE_FAILED, e);\n        }\n    }\n\n    static TableSchema getActualTableSchema(ReadonlyConfig config, boolean includeChangeTypeField) {\n        String projectId = config.get(BigQuerySinkOptions.PROJECT_ID);\n        String datasetId = config.get(BigQuerySinkOptions.DATASET_ID);\n        String tableId = config.get(BigQuerySinkOptions.TABLE_ID);\n        BigQuery bigquery = BigQueryClientFactory.getBigQuery(config);\n        Table table = bigquery.getTable(TableId.of(projectId, datasetId, tableId));\n        if (table == null) {\n            throw new BigQueryConnectorException(\n                    BigQueryConnectorErrorCode.TABLE_NOT_FOUND,\n                    String.format(\n                            \"BigQuery target table does not exist: %s.%s.%s. \"\n                                    + \"Please create the target table before starting the sink.\",\n                            projectId, datasetId, tableId));\n        }\n        Schema bqSchema = table.getDefinition().getSchema();\n        TableSchema.Builder builder = TableSchema.newBuilder();\n\n        if (bqSchema == null || bqSchema.getFields() == null) {\n            throw CommonError.illegalArgument(\n                    String.format(\n                            \"Table %s.%s.%s does not exist or has no schema.\",\n                            projectId, datasetId, tableId),\n                    IDENTIFIER);\n        }\n\n        for (Field field : bqSchema.getFields()) {","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-bigquery/src/main/java/org/apache/seatunnel/connectors/bigquery/sink/writer/TableSchemaUtil.java#L80-L116","documentation":"Thrown by TableSchemaUtil.getActualTableSchema when bigquery.getTable() returns null, i.e. the configured project.dataset.table does not exist in BigQuery. The sink requires the target table to pre-exist because it reads its schema to build the write payload; it refuses to start rather than auto-creating a wrong-shaped table.","triggerScenarios":"getActualTableSchema calls BigQueryClientFactory.getBigQuery(config).getTable(TableId.of(projectId, datasetId, tableId)) and the API returns null because the table (or dataset/project) does not exist or is not visible to the credentials.","commonSituations":"Typo in PROJECT_ID/DATASET_ID/TABLE_ID in the sink config; table created in a different project; credentials lack bigquery.tables.get on the target; using a temp/dev table name that was never created; regional dataset accessed with wrong location settings.","solutions":["Create the target table first (CREATE TABLE in BigQuery or bq mk -t) matching your SeaTunnel schema, then rerun the job.","Verify the three config values with `bq show project:dataset.table` using the same credentials SeaTunnel uses.","Check the service account has BigQuery Table Viewer / Data Editor roles on the dataset.","Confirm dataset location matches the job's expected region and there is no project-id prefix mismatch (e.g. table placed in a different GCP project)."],"exampleFix":"// before (config)\nPROJECT_ID = \"my-proj\"\nDATASET_ID = \"mydataset\"\nTABLE_ID = \"mytable\"\n// after: create the table before running the sink\nbq mk --table my-proj:mydataset.mytable schema.json","handlingStrategy":"validation","validationCode":"bq show --format=prettyjson ${PROJECT_ID}:${DATASET_ID}.${TABLE_ID} || echo 'table missing'","typeGuard":null,"tryCatchPattern":"// catch TABLE_NOT_FOUND and surface a remediation message\ntry {\n    runSink(cfg);\n} catch (BigQueryConnectorException e) {\n    if (BigQueryConnectorErrorCode.TABLE_NOT_FOUND.equals(e.getErrorCode())) {\n        throw new IllegalStateException(\"Create table first: \" + fqtn(cfg), e);\n    } throw e;\n}","preventionTips":["Provision the target table in IaC/Terraform before pipeline deployment.","Verify project/dataset/table with `bq show` using the same service account the job uses.","Grant bigquery.tables.get/dataEditor roles to the job's service account."],"tags":["bigquery","table-not-found","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}