prestodb/presto · error · PrestoException

NOT_FOUND

NOT_FOUND

Error message

%s is empty

What it means

SchemaUtil.checkNotEmpty is an internal guard used by SPI implementations to reject empty string parameters. It throws PrestoException(NOT_FOUND, "<name> is empty") when the value is an empty string (null produces a plain NullPointerException instead).

Source

Thrown at presto-spi/src/main/java/com/facebook/presto/spi/SchemaUtil.java:31

 */
package com.facebook.presto.spi;

import static com.facebook.presto.spi.StandardErrorCode.NOT_FOUND;
import static java.lang.String.format;

final class SchemaUtil
{
    private SchemaUtil()
    {
    }

    static String checkNotEmpty(String value, String name)
    {
        if (value == null) {
            throw new NullPointerException(name + " is null");
        }
        if (value.isEmpty()) {
            throw new PrestoException(NOT_FOUND, format("%s is empty", name));
        }
        return value;
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Provide a non-empty value for the named parameter in your query/config
  2. Check connector configuration properties for empty-string values and set proper defaults
  3. Wrap calls and catch PrestoException with code NOT_FOUND to surface a clearer message to the user

Example fix

// before
connector.getSchemaNames("");
// after
connector.getSchemaNames("default");
Defensive patterns

Strategy: validation

Validate before calling

if (value == null || value.isEmpty()) throw new IllegalArgumentException(name + " must be non-empty");

Try / catch

try { ... } catch (PrestoException e) { if (e.getErrorCode().getCode() == StandardErrorCode.NOT_FOUND.toErrorCodeCode()) { /* handle empty identifier */ } throw e; }

Prevention

When it happens

Trigger: Any SPI method whose implementation calls SchemaUtil.checkNotEmpty (e.g. schema/source/catalog name validation) with an empty string argument, such as getSchemaNames/getTableHandle receiving schema="".

Common situations: Missing configuration property leaving a schema or source name as empty string; user-supplied identifier that was trimmed to nothing; connector config like a hive schema property set to "".

Understand the failure class

Background: NOT_FOUND error code: why tRPC, Harbor, Nacos and other libraries return 404 "not found" errors for resources that may still exist — this error's family across 11 libraries.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/4488a11b46bc97a2. Report an issue: GitHub.