{"record":{"id":"f54cf445d6b357fb","repo":"apache/seatunnel","slug":"table-query-failed-f54cf4","errorCode":"TABLE_QUERY_FAILED","errorMessage":"data_save_mode=ERROR_WHEN_DATA_EXISTS is not yet supported by the Bigtable connector. Please use data_save_mode=APPEND_DATA.","messagePattern":"data_save_mode=ERROR_WHEN_DATA_EXISTS is not yet supported by the Bigtable connector\\. Please use data_save_mode=APPEND_DATA\\.","errorType":"error_code","errorClass":"BigtableConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-google-bigtable/src/main/java/org/apache/seatunnel/connectors/seatunnel/bigtable/sink/BigtableSink.java","lineNumber":115,"sourceCode":"     * accepted-but-no-op settings. Full Admin API support (table creation / truncation) can be\n     * added in a follow-up once a BigtableCatalog is available.\n     */\n    private void handleSaveMode() {\n        if (schemaSaveMode == SchemaSaveMode.CREATE_SCHEMA_WHEN_NOT_EXIST) {\n            throw new BigtableConnectorException(\n                    BigtableConnectorErrorCode.TABLE_CREATE_FAILED,\n                    \"schema_save_mode=CREATE_SCHEMA_WHEN_NOT_EXIST is not yet supported by the \"\n                            + \"Bigtable connector. Please create the table and column families \"\n                            + \"manually and set schema_save_mode=RECREATE_SCHEMA.\");\n        }\n        if (dataSaveMode == DataSaveMode.DROP_DATA) {\n            throw new BigtableConnectorException(\n                    BigtableConnectorErrorCode.TABLE_TRUNCATE_FAILED,\n                    \"data_save_mode=DROP_DATA is not yet supported by the Bigtable connector. \"\n                            + \"Please truncate the table manually or use data_save_mode=APPEND_DATA.\");\n        }\n        if (dataSaveMode == DataSaveMode.ERROR_WHEN_DATA_EXISTS) {\n            throw new BigtableConnectorException(\n                    BigtableConnectorErrorCode.TABLE_QUERY_FAILED,\n                    \"data_save_mode=ERROR_WHEN_DATA_EXISTS is not yet supported by the Bigtable \"\n                            + \"connector. Please use data_save_mode=APPEND_DATA.\");\n        }\n        log.info(\"Bigtable sink save mode: schema={}, data={}\", schemaSaveMode, dataSaveMode);\n    }\n\n    @Override\n    public Optional<CatalogTable> getWriteCatalogTable() {\n        return Optional.ofNullable(catalogTable);\n    }\n}\n","sourceCodeStart":97,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-google-bigtable/src/main/java/org/apache/seatunnel/connectors/seatunnel/bigtable/sink/BigtableSink.java#L97-L128","documentation":"The Bigtable sink's handleSaveMode() rejects DataSaveMode.ERROR_WHEN_DATA_EXISTS because the connector cannot check whether a Bigtable table already contains data. Only APPEND_DATA and (via a separate error) non-DROP_DATA schema handling are supported; the connector throws instead of silently proceeding. This is a fail-fast guard so users don't assume a pre-write existence check happened.","triggerScenarios":"Configuring a Bigtable sink with data_save_mode = ERROR_WHEN_DATA_EXISTS; handleSaveMode is invoked from createWriter during sink initialization before any rows are written.","commonSituations":"Copying a sink config template from another connector (e.g. JDBC) that supports ERROR_WHEN_DATA_EXISTS into a Bigtable sink config; teams wanting upsert-on-existing-table semantics expecting the connector to validate emptiness.","solutions":["Set data_save_mode = APPEND_DATA in the sink config.","If you need an error on non-empty tables, check table emptiness externally (e.g. via cbt or a pre-job query) before submitting the job.","Note DROP_DATA is also unsupported; truncate the table manually if you need a clean target."],"exampleFix":"// before\nsink {\n  GoogleBigtable {\n    data_save_mode = ERROR_WHEN_DATA_EXISTS\n  }\n}\n// after\nsink {\n  GoogleBigtable {\n    data_save_mode = APPEND_DATA\n  }\n}","handlingStrategy":"validation","validationCode":"// before job submission\nif (config.getString(\"data_save_mode\") == \"ERROR_WHEN_DATA_EXISTS\") {\n  throw new IllegalArgumentException(\"Bigtable sink: use data_save_mode = APPEND_DATA\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use APPEND_DATA (or manually manage DROP_DATA) with Bigtable sinks.","Do not copy data_save_mode values from JDBC/other connector templates.","Pre-check table emptiness outside the job if you need ERROR_WHEN_DATA_EXISTS semantics."],"tags":["bigtable","sink","config","save-mode"],"backgroundTag":"unsupported-config-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}