prestodb/presto · error · PrestoException
GENERIC_USER_ERROR
GENERIC_USER_ERROR
Error message
Creating schema in Kudu connector not allowed if schema emulation is disabled.
What it means
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.
Source
Thrown at presto-kudu/src/main/java/com/facebook/presto/kudu/schema/NoSchemaEmulation.java:37
import com.google.common.collect.ImmutableList;
import org.apache.kudu.client.KuduClient;
import java.util.List;
import static com.facebook.presto.kudu.KuduClientSession.DEFAULT_SCHEMA;
import static com.facebook.presto.spi.StandardErrorCode.GENERIC_USER_ERROR;
public class NoSchemaEmulation
implements SchemaEmulation
{
@Override
public void createSchema(KuduClient client, String schemaName)
{
if (DEFAULT_SCHEMA.equals(schemaName)) {
throw new SchemaAlreadyExistsException(schemaName);
}
else {
throw new PrestoException(GENERIC_USER_ERROR, "Creating schema in Kudu connector not allowed if schema emulation is disabled.");
}
}
@Override
public void dropSchema(KuduClient client, String schemaName)
{
if (DEFAULT_SCHEMA.equals(schemaName)) {
throw new PrestoException(GENERIC_USER_ERROR, "Deleting default schema not allowed.");
}
else {
throw new SchemaNotFoundException(schemaName);
}
}
@Override
public boolean existsSchema(KuduClient client, String schemaName)
{
return DEFAULT_SCHEMA.equals(schemaName);View on GitHub (pinned to 55bb57d202)
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
Example fix
// session before CREATE SCHEMA analytics; // after (with kudu.schema-emulation.enabled=true) CREATE SCHEMA analytics; -- works once emulation is enabled
Defensive patterns
Strategy: try-catch
Validate before calling
if (catalogConfig.get("kudu.schema-emulation.enabled", "false").equals("false")) {
throw new IllegalStateException("CREATE SCHEMA not supported: Kudu schema emulation is disabled");
} Try / catch
try {
session.createSchema(schemaName);
} catch (PrestoException e) {
if (e.getMessage().contains("schema emulation is disabled")) {
log.error("Enable kudu.schema-emulation.enabled=true to use CREATE SCHEMA");
return;
}
throw e;
} Prevention
- 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
When it happens
Trigger: CREATE SCHEMA my_schema; on a Kudu catalog with kudu.schema-emulation.enabled=false (not the default schema, hence this branch).
Common situations: Multi-schema workflows ported from Hive/other connectors; teams unaware the Kudu catalog runs in single-schema mode.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/c378c6a2831748c1.
Report an issue: GitHub.