prestodb/presto · error · IllegalArgumentException
catalogName is empty
Error message
catalogName is empty
What it means
ConnectorId is the typed identifier for a catalog in Presto. Its constructor performs validation: a null name fails requireNonNull and an empty string is rejected with this IllegalArgumentException, since catalogs must have non-empty names.
Source
Thrown at presto-spi/src/main/java/com/facebook/presto/spi/ConnectorId.java:40
import java.util.Objects;
import static java.util.Objects.requireNonNull;
@ThriftStruct
public final class ConnectorId
{
private static final String INFORMATION_SCHEMA_CONNECTOR_PREFIX = "$info_schema@";
private static final String SYSTEM_TABLES_CONNECTOR_PREFIX = "$system@";
private final String catalogName;
@ThriftConstructor
@JsonCreator
public ConnectorId(String catalogName)
{
this.catalogName = requireNonNull(catalogName, "catalogName is null");
if (catalogName.isEmpty()) {
throw new IllegalArgumentException("catalogName is empty");
}
}
@ThriftField(1)
public String getCatalogName()
{
return catalogName;
}
@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}View on GitHub (pinned to 55bb57d202)
Solutions
- Pass a non-empty catalog name to ConnectorId
- Check where the name string is built (config keys, path names) for empty values
- Validate the catalog name before constructing ConnectorId
Example fix
// before
ConnectorId id = new ConnectorId(catalogName); // ""
// after
if (catalogName != null && !catalogName.isEmpty()) {
ConnectorId id = new ConnectorId(catalogName);
} Defensive patterns
Strategy: type-guard
Validate before calling
if (catalogName == null || catalogName.isEmpty()) throw new IllegalArgumentException("catalogName must be non-empty"); Type guard
boolean isValidConnectorId(String s) { return s != null && !s.isEmpty(); } Try / catch
try { ConnectorId id = new ConnectorId(name); } catch (IllegalArgumentException e) { /* fall back to default catalog or surface config error */ } Prevention
- Validate catalog names parsed from config/paths before constructing ConnectorId
- Trim and check names sourced from user input or environment
- Use CatalogName abstractions early so emptiness fails at parse time
When it happens
Trigger: Constructing new ConnectorId("") or passing an empty catalog name string, typically derived from an empty config key, catalog name parsing, or metadata lookups.
Common situations: Catalog property file present but catalog name parsed as empty; calling catalog APIs with an empty string from user input or environment variables; misconfigured ConnectorName in properties.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/c74032daa4d7e95f.
Report an issue: GitHub.