apache/seatunnel · error · BigtableConnectorException

TABLE_TRUNCATE_FAILED

TABLE_TRUNCATE_FAILED

Error message

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.

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-google-bigtable/src/main/java/org/apache/seatunnel/connectors/seatunnel/bigtable/sink/BigtableSink.java:109

    /**
     * Validates and applies the configured {@link SchemaSaveMode} and {@link DataSaveMode}.
     *
     * <p>Only {@link SchemaSaveMode#RECREATE_SCHEMA} and {@link DataSaveMode#APPEND_DATA} are
     * currently supported. Unsupported modes throw immediately so users are never misled by
     * accepted-but-no-op settings. Full Admin API support (table creation / truncation) can be
     * added in a follow-up once a BigtableCatalog is available.
     */
    private void handleSaveMode() {
        if (schemaSaveMode == SchemaSaveMode.CREATE_SCHEMA_WHEN_NOT_EXIST) {
            throw new BigtableConnectorException(
                    BigtableConnectorErrorCode.TABLE_CREATE_FAILED,
                    "schema_save_mode=CREATE_SCHEMA_WHEN_NOT_EXIST is not yet supported by the "
                            + "Bigtable connector. Please create the table and column families "
                            + "manually and set schema_save_mode=RECREATE_SCHEMA.");
        }
        if (dataSaveMode == DataSaveMode.DROP_DATA) {
            throw new BigtableConnectorException(
                    BigtableConnectorErrorCode.TABLE_TRUNCATE_FAILED,
                    "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.");
        }
        if (dataSaveMode == DataSaveMode.ERROR_WHEN_DATA_EXISTS) {
            throw new BigtableConnectorException(
                    BigtableConnectorErrorCode.TABLE_QUERY_FAILED,
                    "data_save_mode=ERROR_WHEN_DATA_EXISTS is not yet supported by the Bigtable "
                            + "connector. Please use data_save_mode=APPEND_DATA.");
        }
        log.info("Bigtable sink save mode: schema={}, data={}", schemaSaveMode, dataSaveMode);
    }

    @Override
    public Optional<CatalogTable> getWriteCatalogTable() {
        return Optional.ofNullable(catalogTable);
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set data_save_mode = APPEND_DATA and truncate the table manually beforehand (delete and recreate the table or delete rows via tooling)
  2. Set data_save_mode = CUSTOM_PROCESSING if custom truncation logic is available
  3. Use ERROR_WHEN_DATA_EXISTS if you want a guard against stale data instead of dropping
  4. Contribute Admin-API-based truncation support to the connector

Example fix

// before
sink {
  Bigtable {
    data_save_mode = DROP_DATA
  }
}
// after
sink {
  Bigtable {
    data_save_mode = APPEND_DATA  // truncate table manually first
  }
}
Defensive patterns

Strategy: validation

Validate before calling

if (config.getString("data_save_mode") == "DROP_DATA") {
  throw new IllegalArgumentException("Bigtable sink cannot DROP_DATA; truncate manually or use APPEND_DATA");
}

Try / catch

try {
  sink.open(saveModeHandler);
} catch (BigtableConnectorException e) {
  if (e.getErrorCode() == BigtableConnectorErrorCode.TABLE_TRUNCATE_FAILED)
    LOG.error("Truncate the Bigtable table manually or set APPEND_DATA: {}", e.getMessage());
}

Prevention

When it happens

Trigger: handleSaveMode() during createWriter() detects dataSaveMode == DataSaveMode.DROP_DATA in the sink configuration.

Common situations: 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.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/8ad3c71c923e89fd. Report an issue: GitHub.