apache/beam · error · RuntimeException

TableProvider is null

Error message

TableProvider is null

What it means

DataCatalogTableProvider delegates to other providers (e.g. bigquery, pubsub) based on the table's type field. If a DataCatalog entry's type maps to no registered delegate provider, buildBeamSqlTable throws a RuntimeException("TableProvider is null") rather than silently failing. It indicates a table type that this Beam installation cannot materialize.

Source

Thrown at sdks/java/extensions/sql/datacatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/DataCatalogTableProvider.java:131

  @Override
  public Table getTableByFullName(TableName fullTableName) {

    ImmutableList<String> allNameParts =
        ImmutableList.<String>builder()
            .addAll(fullTableName.getPath())
            .add(fullTableName.getTableName())
            .build();

    String fullEscapedTableName = ZetaSqlIdUtils.escapeAndJoin(allNameParts);

    return loadTable(fullEscapedTableName);
  }

  @Override
  public BeamSqlTable buildBeamSqlTable(Table table) {
    TableProvider tableProvider = DELEGATE_PROVIDERS.get(table.getType());
    if (tableProvider == null) {
      throw new RuntimeException("TableProvider is null");
    }
    return tableProvider.buildBeamSqlTable(table);
  }

  private Table loadTable(String tableName) {
    if (!tableCache.containsKey(tableName)) {
      tableCache.put(tableName, loadTableFromDC(tableName));
    }

    return tableCache.get(tableName);
  }

  private Table loadTableFromDC(String tableName) {
    try {
      return toCalciteTable(
          tableName,
          dataCatalog.lookupEntry(
              LookupEntryRequest.newBuilder().setSqlResource(tableName).build()));

View on GitHub (pinned to 12126d8942)

Solutions

  1. Check table.getType() of the entry and ensure a matching SQL provider (e.g. bigquery) is on the classpath and registered in DELEGATE_PROVIDERS.
  2. Fix the DataCatalog entry so its type corresponds to a supported Beam SQL table type.
  3. Upgrade Beam to a version whose datacatalog provider registers the delegate for that type.

Example fix

// before
// entry type: 'unsupported.system' -> DELEGATE_PROVIDERS.get(...) == null

// after
// re-tag the entry as a BigQuery table so getType() == "bigquery"
// and ensure beam-sdks-java-extensions-sql-bigquery is on the classpath
Defensive patterns

Strategy: validation

Validate before calling

String type = table.getType();
Set<String> supported = Set.of("bigquery", "pubsub", "kafka", ...);
if (!supported.contains(type)) {
  throw new IllegalArgumentException("No delegate SQL provider for type: " + type);
}

Try / catch

try {
  provider.buildBeamSqlTable(table);
} catch (RuntimeException e) {
  if (e.getMessage().contains("TableProvider is null")) {
    // handle unsupported table type
  }
}

Prevention

When it happens

Trigger: A DataCatalog entry whose table.getType() is not one of the keys in DELEGATE_PROVIDERS — e.g. custom/unrecognized types, entries of a service Beam has no SQL provider for, or a Beam version missing a provider that the catalog entry expects.

Common situations: Querying catalog entries registered for unsupported systems; version skew where the entry type (e.g. a newer provider type) predates the Beam release; typos in type registration.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/a1090f030eb51223. Report an issue: GitHub.