Skip to content

[hive] Fix malformed error message for unknown client pool cache key#8639

Open
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/hive-cached-pool-unknown-key-message
Open

[hive] Fix malformed error message for unknown client pool cache key#8639
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/hive-cached-pool-unknown-key-message

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #8638

  • CachedClientPool.extractKey() threw new RuntimeException("Unknown key element %s" + trimmed); RuntimeException(String) does no %s substitution, so users saw a garbled message like Unknown key element %sconf.
  • Reached on a normal misconfiguration: client-pool-cache.keys=conf (missing the conf: prefix) hits the switch default.
  • Drop the literal %s and concatenate trimmed directly. Sibling checks (lines 162-165, 172-175) use Preconditions.checkArgument where %s is a real placeholder.

Tests

  • Added TestCachedClientPool#testExtractKeyUnknownElementErrorMessage asserting the message is exactly Unknown key element conf (proves the literal %s is gone).
  • mvn -pl paimon-hive/paimon-hive-catalog clean install (JDK 11) passed: checkstyle, spotless, rat, and TestCachedClientPool (14 tests) green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Malformed error message for unknown client pool cache key element

1 participant