prestodb/presto · error · PrestoException
JDBC_ERROR
JDBC_ERROR
Error message
Failed to find remote table name:
What it means
PrestoException (JDBC_ERROR) thrown while resolving a requested table name to its remote (physical) ClickHouse table name. When case-sensitive name mapping is enabled, the connector consults a mapping table; if a runtime exception occurs during that lookup, it is wrapped with 'Failed to find remote table name: <msg>'. The original exception is retained as cause.
Source
Thrown at presto-clickhouse/src/main/java/com/facebook/presto/plugin/clickhouse/ClickHouseClient.java:640
"Please switch to using 'case-sensitive-name-matching' for proper case sensitivity behavior."));
try {
com.facebook.presto.plugin.clickhouse.RemoteTableNameCacheKey cacheKey = new com.facebook.presto.plugin.clickhouse.RemoteTableNameCacheKey(identity, remoteSchema);
Map<String, String> mapping = remoteTableNames.getIfPresent(cacheKey);
if (mapping != null && !mapping.containsKey(tableName)) {
// This might be a table that has just been created. Force reload.
mapping = null;
}
if (mapping == null) {
mapping = listTablesByLowerCase(connection, remoteSchema);
remoteTableNames.put(cacheKey, mapping);
}
String remoteTable = mapping.get(tableName);
if (remoteTable != null) {
return remoteTable;
}
}
catch (RuntimeException e) {
throw new PrestoException(JDBC_ERROR, "Failed to find remote table name: " + firstNonNull(e.getMessage(), e), e);
}
}
try {
DatabaseMetaData metadata = connection.getMetaData();
if (metadata.storesUpperCaseIdentifiers() && !caseSensitiveNameMatchingEnabled) {
return tableName.toUpperCase(ENGLISH);
}
return tableName;
}
catch (SQLException e) {
throw new PrestoException(JDBC_ERROR, e);
}
}
public void rollbackCreateTable(ClickHouseIdentity identity, ClickHouseOutputTableHandle handle)
{
dropTable(identity, new ClickHouseTableHandle(View on GitHub (pinned to 55bb57d202)
Solutions
- Read the nested cause message; it says why the mapping lookup failed.
- Verify case-sensitive-name-matching configuration (remote mapping JNDI/schema/table settings).
- Confirm the mapping source is reachable and the connecting user has SELECT rights on it.
- If case mapping is unnecessary, disable it so resolution uses plain JDBC metadata.
- Check that the target table exists with exactly the configured case.
Example fix
// before (properties) case-sensitive-name-matching=true // after: only enable with a valid, reachable mapping source case-sensitive-name-matching=true case-insensitive-name-mapping.config-file=/etc/presto/mapping.json # verified path
Defensive patterns
Strategy: validation
Validate before calling
// check config before connecting
boolean nameMatching = Boolean.parseBoolean(props.getProperty("case-sensitive-name-mapping", "false"));
if (nameMatching && props.getProperty("remote-mapping.database") == null) {
throw new IllegalStateException("remote mapping source must be configured when name matching is on");
} Try / catch
try {
metadata.getTableHandle(session, tableName);
} catch (PrestoException e) {
if (e.getMessage().startsWith("Failed to find remote table name")) {
log.error("name-mapping lookup failed", e.getCause());
// fall back to exact-case table name without mapping
}
throw e;
} Prevention
- Verify mapping-source connectivity and permissions when enabling name matching.
- Use exact-case table names so mapping is not needed.
- Validate connector properties against the documented schema at deploy time.
- Monitor the mapping source for availability.
When it happens
Trigger: case-sensitive-name-matching is enabled and the code path resolving the mapping (remote mapping lookup / query against mapping source) throws a RuntimeException before falling through to JDBC metadata resolution.
Common situations: Mapping configuration errors (bad remote mapping JDBC URL/table); permission failures reading the mapping source; typo in case-insensitive-mapping settings; mapping table missing while name matching is enabled.
Related errors
- JDBC_ERROR
- NOT_SUPPORTED
- NOT_FOUND
- ARROW_INTERNAL_ERROR
- Only one of 'case-insensitive-name-matching=true' or 'case-s
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/5475d857e40da4d2.
Report an issue: GitHub.