apache/seatunnel · error · BigtableConnectorException

TABLE_CREATE_FAILED

TABLE_CREATE_FAILED

Error message

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.

What it means

BigtableSink.handleSaveMode throws BigtableConnectorException (TABLE_CREATE_FAILED) because schema_save_mode=CREATE_SCHEMA_WHEN_NOT_EXIST is explicitly unsupported — there is no BigtableCatalog/table-creation support yet. The connector fails fast instead of silently ignoring the setting.

Source

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

        }
        if (parameters.getVersionColumn() != null) {
            this.versionColumnIndex = rowType.indexOf(parameters.getVersionColumn());
        }
        handleSaveMode();
        return new BigtableSinkWriter(rowType, parameters, rowkeyColumnIndexes, versionColumnIndex);
    }

    /**
     * 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);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Create the Bigtable table and its column families manually (gcloud or console) before running the job
  2. Set schema_save_mode = RECREATE_SCHEMA if recreation semantics are acceptable per the message
  3. Set schema_save_mode = ERROR_WHEN_SCHEMA_NOT_EXIST after ensuring the table exists
  4. Implement Bigtable Admin API-based table creation in the connector as a contribution

Example fix

// before
sink {
  Bigtable {
    schema_save_mode = CREATE_SCHEMA_WHEN_NOT_EXIST
  }
}
// after
sink {
  Bigtable {
    schema_save_mode = RECREATE_SCHEMA  // or create the table manually first
  }
}
Defensive patterns

Strategy: validation

Validate before calling

if (config.getString("schema_save_mode") == "CREATE_SCHEMA_WHEN_NOT_EXIST") {
  throw new IllegalArgumentException("Bigtable sink requires RECREATE_SCHEMA or an existing table");
}

Try / catch

try {
  sink.open(saveModeHandler);
} catch (BigtableConnectorException e) {
  if (e.getErrorCode() == BigtableConnectorErrorCode.TABLE_CREATE_FAILED)
    // create table + column families via gcloud, then rerun
    LOG.error("Create the Bigtable table manually; see message: {}", e.getMessage());
}

Prevention

When it happens

Trigger: handleSaveMode() is invoked during createWriter() and detects schemaSaveMode == SchemaSaveMode.CREATE_SCHEMA_WHEN_NOT_EXIST in the sink configuration.

Common situations: Users relying on the common default behavior of auto-creating missing tables run the Bigtable sink against a table that does not exist and hit the error at writer startup.

Related errors


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