{"record":{"id":"38a059e437922306","repo":"apache/seatunnel","slug":"table-name-is-empty","errorCode":null,"errorMessage":"Table name is empty","messagePattern":"Table name is empty","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/IcebergTableLoader.java","lineNumber":102,"sourceCode":"    @VisibleForTesting\n    public static IcebergTableLoader create(IcebergCommonConfig config) {\n        return create(config, null);\n    }\n\n    public static IcebergTableLoader create(IcebergCommonConfig config, CatalogTable catalogTable) {\n        IcebergCatalogLoader catalogFactory = new IcebergCatalogLoader(config);\n        String table;\n        if (Objects.nonNull(catalogTable)\n                && StringUtils.isNotEmpty(catalogTable.getTableId().getTableName())) {\n            log.info(\n                    \"Config table name is empty, use catalog table name: {}\",\n                    catalogTable.getTableId().getTableName());\n            table = catalogTable.getTableId().getTableName();\n        } else if (StringUtils.isNotEmpty(config.getTable())) {\n            // for test in sink\n            table = config.getTable();\n        } else {\n            throw new IllegalArgumentException(\"Table name is empty\");\n        }\n        return new IcebergTableLoader(\n                catalogFactory, TableIdentifier.of(Namespace.of(config.getNamespace()), table));\n    }\n}\n","sourceCodeStart":84,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/IcebergTableLoader.java#L84-L108","documentation":"IcebergTableLoader.create resolves the target table name from the loaded CatalogTable's TableId or from the connector config's 'table' option. If neither yields a non-empty name it throws IllegalArgumentException(\"Table name is empty\"), because a TableIdentifier cannot be built without a table name.","triggerScenarios":"create is called and catalogTable's table id is empty/absent AND config.getTable() returns null or empty string — e.g. sink config omits 'table' and the upstream metadata provides no table name.","commonSituations":"Sink config missing the table option when writing in tests or with a catalog that doesn't supply table ids; upstream metadata keys changed so the fallback path no longer populates the name.","solutions":["Set the 'table' option explicitly in the Iceberg sink/source config so config.getTable() is non-empty","If relying on catalog-provided table ids, verify the upstream CatalogTable actually carries a TableId","Update config to include namespace+table as expected by the catalog factory in use"],"exampleFix":"// before\nsink { Iceberg { namespace = \"db\" } }\n// after\nsink { Iceberg { namespace = \"db\", table = \"events\" } }","handlingStrategy":"validation","validationCode":"String table = config.getTable();\nif (table == null || table.isEmpty()) {\n  throw new IllegalArgumentException(\"Set the 'table' option in the Iceberg config\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  IcebergTableLoader loader = IcebergTableLoader.create(...);\n} catch (IllegalArgumentException e) {\n  if (\"Table name is empty\".equals(e.getMessage())) {\n    // add table=<name> to config and retry\n  } else throw e;\n}","preventionTips":["Always set the table option for Iceberg sinks/sources unless the catalog reliably supplies table ids","Validate required options (namespace, table) at config load time","Include table name in config templates used for tests"],"tags":["iceberg","config","table-name"],"backgroundTag":"empty-required-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}