{"record":{"id":"326575d09b7644a3","repo":"apache/iceberg","slug":"this-getclass-getname-does-not-implement-b","errorCode":null,"errorMessage":"this.getClass().getName() + \" does not implement buildTable\"","messagePattern":"this\\.getClass\\(\\)\\.getName\\(\\) \\+ \" does not implement buildTable\"","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/catalog/Catalog.java","lineNumber":393,"sourceCode":"   */\n  default Table registerTable(\n      TableIdentifier identifier, String metadataFileLocation, boolean overwrite) {\n    if (!overwrite) {\n      return registerTable(identifier, metadataFileLocation);\n    }\n\n    throw new UnsupportedOperationException(\"Registering tables with overwrite is not supported\");\n  }\n\n  /**\n   * Instantiate a builder to either create a table or start a create/replace transaction.\n   *\n   * @param identifier a table identifier\n   * @param schema a schema\n   * @return the builder to create a table or start a create/replace transaction\n   */\n  default TableBuilder buildTable(TableIdentifier identifier, Schema schema) {\n    throw new UnsupportedOperationException(\n        this.getClass().getName() + \" does not implement buildTable\");\n  }\n\n  /**\n   * Initialize a catalog given a custom name and a map of catalog properties.\n   *\n   * <p>A custom Catalog implementation must have a no-arg constructor. A compute engine like Spark\n   * or Flink will first initialize the catalog without any arguments, and then call this method to\n   * complete catalog initialization with properties passed into the engine.\n   *\n   * @param name a custom name for the catalog\n   * @param properties catalog properties\n   */\n  default void initialize(String name, Map<String, String> properties) {}\n\n  /**\n   * A builder used to create valid {@link Table tables} or start create/replace {@link Transaction\n   * transactions}.","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/catalog/Catalog.java#L375-L411","documentation":"Catalog.buildTable(identifier, schema) is a default method that throws UnsupportedOperationException naming the concrete class that failed to implement it. It is the entry point for all builder-based table operations (create, replace, stage, transactions), so any catalog that does not override it cannot participate in these flows. The message includes the class name to identify which catalog lacks the implementation.","triggerScenarios":"Calling catalog.buildTable(ident, schema), or any API that routes through it (createTable via builder path, newCreateTableTransaction, stageTableCreate, tableBuilder, transaction(tableBuilder)) on a Catalog implementation that does not override buildTable.","commonSituations":"Implementing a minimal custom Catalog (e.g. for tests or a thin wrapper) that satisfies name()/listTables()/dropTable() but not the builder method; passing a partial Catalog mock into code that calls buildTable; using an older third-party catalog written before buildTable was added.","solutions":["Implement buildTable(identifier, schema) returning a real TableBuilder in the custom catalog implementation","Use a fully-featured catalog implementation (Hive, JDBC, REST, Nessie) instead of the partial one","In test code, replace the stub catalog with a full mock/stub that returns a builder","If using a third-party catalog, upgrade it to a version supporting the TableBuilder API"],"exampleFix":"// before\nclass MyCatalog implements Catalog { /* buildTable not overridden */ }\ncatalog.createTable(ident, schema);\n// after\nclass MyCatalog implements Catalog {\n  @Override\n  public TableBuilder buildTable(TableIdentifier ident, Schema schema) {\n    return new MyTableBuilder(ident, schema);\n  }\n}","handlingStrategy":"try-catch","validationCode":"// Reject incomplete Catalog implementations at wiring time\nif (catalog.buildTable(ident, schema) instanceof UnsupportedTableBuilder) { ... } // or catch at first use","typeGuard":null,"tryCatchPattern":"try {\n  TableBuilder b = catalog.buildTable(ident, schema);\n} catch (UnsupportedOperationException e) {\n  throw new IllegalStateException(\"Catalog does not implement buildTable: \" + e.getMessage(), e);\n}","preventionTips":["Always implement buildTable when writing a custom Catalog; it underpins create/replace/transaction flows","Use CatalogUtil or extend BaseCatalog to inherit builder plumbing","Keep custom catalogs compiling against the current Iceberg API version","Smoke-test createTable/stageCreate/transaction paths for any new catalog implementation"],"tags":["java","unsupported-operation","catalog","table-builder"],"backgroundTag":"method-not-implemented","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}