{"record":{"id":"503cde9eaad4b036","repo":"apache/seatunnel","slug":"table-create-exception","errorCode":"TABLE_CREATE_EXCEPTION","errorMessage":"HbaseConnectorErrorCode.TABLE_CREATE_EXCEPTION.getErrorMessage()","messagePattern":"HbaseConnectorErrorCode\\.TABLE_CREATE_EXCEPTION\\.getErrorMessage\\(\\)","errorType":"error_code","errorClass":"HbaseConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/client/HbaseClient.java","lineNumber":229,"sourceCode":"            TableName table = TableName.valueOf(databaseName, tableName);\n            if (tableExists(table.getNameAsString())) {\n                log.info(\"Table {} already exists.\", table.getNameAsString());\n                if (!ignoreIfExists) {\n                    throw new HbaseConnectorException(\n                            HbaseConnectorErrorCode.TABLE_EXISTS_EXCEPTION,\n                            HbaseConnectorErrorCode.TABLE_EXISTS_EXCEPTION.getErrorMessage());\n                }\n                return;\n            }\n            TableDescriptorBuilder hbaseTableDescriptor = TableDescriptorBuilder.newBuilder(table);\n            columnFamilies.forEach(\n                    family ->\n                            hbaseTableDescriptor.setColumnFamily(\n                                    ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes(family))\n                                            .build()));\n            admin.createTable(hbaseTableDescriptor.build());\n        } catch (IOException e) {\n            throw new HbaseConnectorException(\n                    HbaseConnectorErrorCode.TABLE_CREATE_EXCEPTION,\n                    HbaseConnectorErrorCode.TABLE_CREATE_EXCEPTION.getErrorMessage(),\n                    e);\n        }\n    }\n\n    /**\n     * Drop a table.\n     *\n     * @param databaseName database name\n     * @param tableName table name\n     */\n    public void dropTable(String databaseName, String tableName) {\n        try {\n            TableName table = TableName.valueOf(databaseName, tableName);\n            admin.disableTable(table);\n            admin.deleteTable(table);\n        } catch (IOException e) {","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/client/HbaseClient.java#L211-L247","documentation":"createTable() issues admin.createTable(descriptor) after building the TableDescriptor; any IOException during table creation (including namespace creation inside the try) is wrapped as HbaseConnectorException with TABLE_CREATE_EXCEPTION.","triggerScenarios":"Calling createTable() when admin.createTable fails: table created concurrently by another process, invalid column family/region config, cluster unavailable, or permission denied on create.","commonSituations":"Two jobs racing to create the same table; HMaster unavailable during job start; user lacks CREATE permission; invalid pre-split keys or region counts; disk issues on RegionServers.","solutions":["Check whether the table was created concurrently and either reuse it (ignoreIfExists) or drop it first","Verify the user has CREATE privileges on the namespace","Validate column families and region/split configuration","Inspect the wrapped IOException cause; confirm HMaster and RegionServer health","Retry after resolving transient cluster problems"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-validate config and existence\nif (client.tableExists(TableName.valueOf(ns, table).getNameAsString()) && !ignoreIfExists) {\n    throw new IllegalStateException(\"Table already exists: \" + ns + \":\" + table);\n}\n// verify CREATE privilege\ntry (Connection c = ConnectionFactory.createConnection(conf); Admin a = c.getAdmin()) {\n    a.getClusterStatus();\n}","typeGuard":null,"tryCatchPattern":"try {\n    client.createTable(ns, table, families, ignoreIfExists);\n} catch (HbaseConnectorException e) {\n    if (e.getErrorCode() == HbaseConnectorErrorCode.TABLE_CREATE_EXCEPTION) {\n        if (client.tableExists(TableName.valueOf(ns, table).getNameAsString())) {\n            log.warn(\"Table was created concurrently; continuing\");\n        } else {\n            throw e;\n        }\n    } else throw e;\n}","preventionTips":["Ensure CREATE permission on the namespace for the job user","Avoid concurrent jobs creating the same table; use ignoreIfExists","Validate column families, splits and region config before creating","Check HMaster/RegionServer health before schema changes"],"tags":["hbase","table","create","admin"],"backgroundTag":"database-write-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}