{"record":{"id":"c378c6a2831748c1","repo":"prestodb/presto","slug":"generic-user-error-c378c6","errorCode":"GENERIC_USER_ERROR","errorMessage":"Creating schema in Kudu connector not allowed if schema emulation is disabled.","messagePattern":"Creating schema in Kudu connector not allowed if schema emulation is disabled\\.","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-kudu/src/main/java/com/facebook/presto/kudu/schema/NoSchemaEmulation.java","lineNumber":37,"sourceCode":"import com.google.common.collect.ImmutableList;\nimport org.apache.kudu.client.KuduClient;\n\nimport java.util.List;\n\nimport static com.facebook.presto.kudu.KuduClientSession.DEFAULT_SCHEMA;\nimport static com.facebook.presto.spi.StandardErrorCode.GENERIC_USER_ERROR;\n\npublic class NoSchemaEmulation\n        implements SchemaEmulation\n{\n    @Override\n    public void createSchema(KuduClient client, String schemaName)\n    {\n        if (DEFAULT_SCHEMA.equals(schemaName)) {\n            throw new SchemaAlreadyExistsException(schemaName);\n        }\n        else {\n            throw new PrestoException(GENERIC_USER_ERROR, \"Creating schema in Kudu connector not allowed if schema emulation is disabled.\");\n        }\n    }\n\n    @Override\n    public void dropSchema(KuduClient client, String schemaName)\n    {\n        if (DEFAULT_SCHEMA.equals(schemaName)) {\n            throw new PrestoException(GENERIC_USER_ERROR, \"Deleting default schema not allowed.\");\n        }\n        else {\n            throw new SchemaNotFoundException(schemaName);\n        }\n    }\n\n    @Override\n    public boolean existsSchema(KuduClient client, String schemaName)\n    {\n        return DEFAULT_SCHEMA.equals(schemaName);","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-kudu/src/main/java/com/facebook/presto/kudu/schema/NoSchemaEmulation.java#L19-L55","documentation":"NoSchemaEmulation.createSchema rejects any schema creation when schema emulation is disabled: the default schema always exists (SchemaAlreadyExistsException) and other names are not allowed at all, throwing GENERIC_USER_ERROR with an explicit message.","triggerScenarios":"CREATE SCHEMA my_schema; on a Kudu catalog with kudu.schema-emulation.enabled=false (not the default schema, hence this branch).","commonSituations":"Multi-schema workflows ported from Hive/other connectors; teams unaware the Kudu catalog runs in single-schema mode.","solutions":["Enable schema emulation (kudu.schema-emulation.enabled=true) to allow CREATE SCHEMA","Use the default schema without creating any schema","Redirect the DDL to a connector that supports schemas"],"exampleFix":"// session before\nCREATE SCHEMA analytics;\n// after (with kudu.schema-emulation.enabled=true)\nCREATE SCHEMA analytics; -- works once emulation is enabled","handlingStrategy":"try-catch","validationCode":"if (catalogConfig.get(\"kudu.schema-emulation.enabled\", \"false\").equals(\"false\")) {\n    throw new IllegalStateException(\"CREATE SCHEMA not supported: Kudu schema emulation is disabled\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    session.createSchema(schemaName);\n} catch (PrestoException e) {\n    if (e.getMessage().contains(\"schema emulation is disabled\")) {\n        log.error(\"Enable kudu.schema-emulation.enabled=true to use CREATE SCHEMA\");\n        return;\n    }\n    throw e;\n}","preventionTips":["Verify kudu.schema-emulation.enabled before schema DDL in deployment scripts","Keep all objects in the default schema when emulation is off","Route multi-schema DDL to connectors that support it"],"tags":["kudu","schema","configuration"],"backgroundTag":"operation-not-supported","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"}