{"record":{"id":"5475d857e40da4d2","repo":"prestodb/presto","slug":"jdbc-error-5475d8","errorCode":"JDBC_ERROR","errorMessage":"Failed to find remote table name: ","messagePattern":"Failed to find remote table name: ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-clickhouse/src/main/java/com/facebook/presto/plugin/clickhouse/ClickHouseClient.java","lineNumber":640,"sourceCode":"                            \"Please switch to using 'case-sensitive-name-matching' for proper case sensitivity behavior.\"));\n            try {\n                com.facebook.presto.plugin.clickhouse.RemoteTableNameCacheKey cacheKey = new com.facebook.presto.plugin.clickhouse.RemoteTableNameCacheKey(identity, remoteSchema);\n                Map<String, String> mapping = remoteTableNames.getIfPresent(cacheKey);\n                if (mapping != null && !mapping.containsKey(tableName)) {\n                    // This might be a table that has just been created. Force reload.\n                    mapping = null;\n                }\n                if (mapping == null) {\n                    mapping = listTablesByLowerCase(connection, remoteSchema);\n                    remoteTableNames.put(cacheKey, mapping);\n                }\n                String remoteTable = mapping.get(tableName);\n                if (remoteTable != null) {\n                    return remoteTable;\n                }\n            }\n            catch (RuntimeException e) {\n                throw new PrestoException(JDBC_ERROR, \"Failed to find remote table name: \" + firstNonNull(e.getMessage(), e), e);\n            }\n        }\n\n        try {\n            DatabaseMetaData metadata = connection.getMetaData();\n            if (metadata.storesUpperCaseIdentifiers() && !caseSensitiveNameMatchingEnabled) {\n                return tableName.toUpperCase(ENGLISH);\n            }\n            return tableName;\n        }\n        catch (SQLException e) {\n            throw new PrestoException(JDBC_ERROR, e);\n        }\n    }\n\n    public void rollbackCreateTable(ClickHouseIdentity identity, ClickHouseOutputTableHandle handle)\n    {\n        dropTable(identity, new ClickHouseTableHandle(","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-clickhouse/src/main/java/com/facebook/presto/plugin/clickhouse/ClickHouseClient.java#L622-L658","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (properties)\ncase-sensitive-name-matching=true\n// after: only enable with a valid, reachable mapping source\ncase-sensitive-name-matching=true\ncase-insensitive-name-mapping.config-file=/etc/presto/mapping.json  # verified path","handlingStrategy":"validation","validationCode":"// check config before connecting\nboolean nameMatching = Boolean.parseBoolean(props.getProperty(\"case-sensitive-name-mapping\", \"false\"));\nif (nameMatching && props.getProperty(\"remote-mapping.database\") == null) {\n    throw new IllegalStateException(\"remote mapping source must be configured when name matching is on\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    metadata.getTableHandle(session, tableName);\n} catch (PrestoException e) {\n    if (e.getMessage().startsWith(\"Failed to find remote table name\")) {\n        log.error(\"name-mapping lookup failed\", e.getCause());\n        // fall back to exact-case table name without mapping\n    }\n    throw e;\n}","preventionTips":["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."],"tags":["clickhouse","jdbc","connector","name-mapping","configuration"],"backgroundTag":"remote-table-name-resolution-failed","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"}