{"record":{"id":"608ddabb928d4ab9","repo":"apache/seatunnel","slug":"failed-to-create-table-tablepath","errorCode":null,"errorMessage":"Failed to create table: ${tablePath}","messagePattern":"Failed to create table: (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java","lineNumber":644,"sourceCode":"            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {\n        try {\n            if (!databaseExists(tablePath.getDatabaseName())) {\n                throw new DatabaseNotExistException(\"hive\", tablePath.getDatabaseName());\n            }\n\n            if (tableExists(tablePath.getDatabaseName(), tablePath.getTableName())) {\n                if (!ignoreIfExists) {\n                    throw new TableAlreadyExistException(\"hive\", tablePath);\n                }\n                return;\n            }\n\n            Table hiveTable = convertCatalogTableToHiveTable(tablePath, table);\n            createTableIfNotExists(hiveTable);\n        } catch (TableAlreadyExistException | DatabaseNotExistException | CatalogException e) {\n            throw e;\n        } catch (HiveConnectorException e) {\n            throw new CatalogException(\"Failed to create table: \" + tablePath, e);\n        } catch (TException e) {\n            throw new CatalogException(\"Failed to create table: \" + tablePath, e);\n        }\n    }\n\n    @Override\n    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        if (!tableExists(tablePath) && !ignoreIfNotExists) {\n            throw new TableNotExistException(\"hive\", tablePath);\n        }\n        if (tableExists(tablePath)) {\n            dropTable(tablePath.getDatabaseName(), tablePath.getTableName());\n        }\n    }\n\n    @Override\n    public void createDatabase(TablePath tablePath, boolean ignoreIfExists)","sourceCodeStart":626,"sourceCodeEnd":662,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java#L626-L662","documentation":"createTable() wraps any HiveConnectorException from the internal createTableIfNotExists()/convertCatalogTableToHiveTable() path into a CatalogException. The DDL reached Hive metadata logic but the table could not be created or converted.","triggerScenarios":"Calling createTable(tablePath, table, ignoreIfExists) when the internal createTableIfNotExists(hiveTable) throws HiveConnectorException — e.g., conversion failure of CatalogTable to Hive Table, invalid schema/partition keys, or metastore rejection.","commonSituations":"Unsupported SeaTunnel data types for Hive mapping; schema mismatch (e.g., missing fields); Hive restrictions on table/column names; metastore permission denied on the warehouse directory.","solutions":["Inspect the HiveConnectorException cause for the exact conversion or metastore rejection reason.","Validate the CatalogTable schema uses Hive-supported types and legal column names.","Check HDFS/warehouse write permissions for the metastore user.","Test the equivalent CREATE TABLE DDL directly in Hive to surface restriction errors."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// validate schema types are Hive-compatible before create\nfor (CatalogTable.Column c : table.getTableSchema().getColumns()) {\n    // assert SeaTunnelType -> Hive type mapping exists\n}","typeGuard":null,"tryCatchPattern":"try {\n    catalog.createTable(tablePath, table, ignoreIfExists);\n} catch (CatalogException e) {\n    Throwable cause = e.getCause();\n    // log schema + cause; check for conversion/permission errors\n}","preventionTips":["Verify schemas map to Hive-supported types before creating tables.","Check warehouse/HDFS write permissions for the metastore user.","Dry-run the equivalent CREATE TABLE DDL in Hive first."],"tags":["hive","catalog","create-table","schema-mapping"],"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-14T11:17:12.474Z"}