{"record":{"id":"7dab61ea2b890e68","repo":"prestodb/presto","slug":"s-is-not-a-valid-table-type-to-be-created","errorCode":null,"errorMessage":"%s is not a valid table type to be created.","messagePattern":"(.+?) is not a valid table type to be created\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java","lineNumber":1118,"sourceCode":"        if (tableType.equals(EXTERNAL_TABLE)) {\n            if (!createsOfNonManagedTablesEnabled) {\n                throw new PrestoException(NOT_SUPPORTED, \"Cannot create non-managed Hive table\");\n            }\n            String externalLocation = getExternalLocation(tableMetadata.getProperties());\n            targetPath = MetastoreUtil.getExternalPath(\n                    hdfsEnvironment,\n                    new HdfsContext(session, schemaName, tableName, externalLocation, true),\n                    externalLocation);\n        }\n        else if (tableType.equals(MANAGED_TABLE) || tableType.equals(MATERIALIZED_VIEW)) {\n            LocationHandle locationHandle = locationService.forNewTable(metastore, session, schemaName, tableName, isTempPathRequired(session, bucketProperty, preferredOrderingColumns));\n            targetPath = locationService.getQueryWriteInfo(locationHandle).getTargetPath();\n            if (getFooterSkipCount(tableMetadata.getProperties()).isPresent()) {\n                throw new PrestoException(NOT_SUPPORTED, format(\"Cannot create non external table with %s property\", SKIP_FOOTER_COUNT_KEY));\n            }\n        }\n        else {\n            throw new IllegalStateException(format(\"%s is not a valid table type to be created.\", tableType));\n        }\n\n        Map<String, String> tableProperties = getEmptyTableProperties(\n                tableMetadata,\n                new HdfsContext(session, schemaName, tableName, targetPath.toString(), true),\n                hiveStorageFormat,\n                tableEncryptionProperties);\n\n        return buildTableObject(\n                session.getQueryId(),\n                schemaName,\n                tableName,\n                session.getUser(),\n                columnHandles,\n                hiveStorageFormat,\n                partitionedBy,\n                bucketProperty,\n                preferredOrderingColumns,","sourceCodeStart":1100,"sourceCodeEnd":1136,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java#L1100-L1136","documentation":"End of the table-type switch in table creation: the requested table type (from hive.table-type property) is neither EXTERNAL_TABLE, MANAGED_TABLE, nor the other recognized types, so the connector cannot create it.","triggerScenarios":"Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java:1118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the table type property to a supported Hive table type","Check spelling of the external/table type property in CREATE TABLE"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}