{"record":{"id":"8ad3c71c923e89fd","repo":"apache/seatunnel","slug":"table-truncate-failed","errorCode":"TABLE_TRUNCATE_FAILED","errorMessage":"data_save_mode=DROP_DATA is not yet supported by the Bigtable connector. Please truncate the table manually or use data_save_mode=APPEND_DATA.","messagePattern":"data_save_mode=DROP_DATA is not yet supported by the Bigtable connector\\. Please truncate the table manually or 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":109,"sourceCode":"\n    /**\n     * Validates and applies the configured {@link SchemaSaveMode} and {@link DataSaveMode}.\n     *\n     * <p>Only {@link SchemaSaveMode#RECREATE_SCHEMA} and {@link DataSaveMode#APPEND_DATA} are\n     * currently supported. Unsupported modes throw immediately so users are never misled by\n     * 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}","sourceCodeStart":91,"sourceCodeEnd":127,"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#L91-L127","documentation":"BigtableSink.handleSaveMode throws BigtableConnectorException (TABLE_TRUNCATE_FAILED) because data_save_mode=DROP_DATA is not implemented — the connector cannot truncate Bigtable tables. It fails fast rather than pretending to drop data.","triggerScenarios":"handleSaveMode() during createWriter() detects dataSaveMode == DataSaveMode.DROP_DATA in the sink configuration.","commonSituations":"Users migrating configs from other sinks that support DROP_DATA expect pre-write truncation; the Bigtable job fails at startup instead of clearing old data.","solutions":["Set data_save_mode = APPEND_DATA and truncate the table manually beforehand (delete and recreate the table or delete rows via tooling)","Set data_save_mode = CUSTOM_PROCESSING if custom truncation logic is available","Use ERROR_WHEN_DATA_EXISTS if you want a guard against stale data instead of dropping","Contribute Admin-API-based truncation support to the connector"],"exampleFix":"// before\nsink {\n  Bigtable {\n    data_save_mode = DROP_DATA\n  }\n}\n// after\nsink {\n  Bigtable {\n    data_save_mode = APPEND_DATA  // truncate table manually first\n  }\n}","handlingStrategy":"validation","validationCode":"if (config.getString(\"data_save_mode\") == \"DROP_DATA\") {\n  throw new IllegalArgumentException(\"Bigtable sink cannot DROP_DATA; truncate manually or use APPEND_DATA\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  sink.open(saveModeHandler);\n} catch (BigtableConnectorException e) {\n  if (e.getErrorCode() == BigtableConnectorErrorCode.TABLE_TRUNCATE_FAILED)\n    LOG.error(\"Truncate the Bigtable table manually or set APPEND_DATA: {}\", e.getMessage());\n}","preventionTips":["Never use data_save_mode=DROP_DATA with the Bigtable sink","Truncate tables via Admin API/gcloud before reruns","Use APPEND_DATA with explicit manual cleanup in your pipeline scripts","Review save-mode configs when porting jobs between connectors"],"tags":["bigtable","data-save-mode","config","unsupported-feature"],"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-14T16:17:12.679Z"}