apache/seatunnel · error · BigtableConnectorException

TABLE_QUERY_FAILED

TABLE_QUERY_FAILED

Error message

data_save_mode=ERROR_WHEN_DATA_EXISTS is not yet supported by the Bigtable connector. Please use data_save_mode=APPEND_DATA.

What it means

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.

Source

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

     * 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 in the sink config.
  2. 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.
  3. Note DROP_DATA is also unsupported; truncate the table manually if you need a clean target.

Example fix

// before
sink {
  GoogleBigtable {
    data_save_mode = ERROR_WHEN_DATA_EXISTS
  }
}
// after
sink {
  GoogleBigtable {
    data_save_mode = APPEND_DATA
  }
}
Defensive patterns

Strategy: validation

Validate before calling

// before job submission
if (config.getString("data_save_mode") == "ERROR_WHEN_DATA_EXISTS") {
  throw new IllegalArgumentException("Bigtable sink: use data_save_mode = APPEND_DATA");
}

Prevention

When it happens

Trigger: 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.

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

Related errors


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