pan3793 commented on code in PR #7431:
URL: https://github.com/apache/kyuubi/pull/7431#discussion_r3298357282
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/EngineRef.scala:
##########
@@ -258,15 +259,28 @@ private[kyuubi] class EngineRef(
engineRefId,
extraEngineLog,
defaultEngineName)
+ case CHAT =>
+ new ChatProcessBuilder(appUser, doAsEnabled, conf, engineRefId,
extraEngineLog)
case DATA_AGENT =>
if (conf.get(ENGINE_DATA_AGENT_JDBC_URL).isEmpty) {
val haAddresses = conf.get(HA_ADDRESSES)
- if (haAddresses.nonEmpty) {
- val jdbcUrl = s"jdbc:hive2://$haAddresses/default;" +
+ val isZkHa = haAddresses.nonEmpty &&
+ conf.get(HA_CLIENT_CLASS).endsWith("ZookeeperDiscoveryClient")
+ val jdbcUrl = if (isZkHa) {
+ s"jdbc:hive2://$haAddresses/default;" +
s"serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=$serverSpace"
- conf.set(ENGINE_DATA_AGENT_JDBC_URL.key, jdbcUrl)
- info(s"Data Agent JDBC URL not configured, using Kyuubi server via
ZK: $jdbcUrl")
+ } else {
+ val port = conf.get(FRONTEND_THRIFT_BINARY_BIND_PORT)
+ if (port == 0) {
+ throw KyuubiSQLException(
+ s"Cannot derive a default Data Agent JDBC URL: " +
+ s"${FRONTEND_THRIFT_BINARY_BIND_PORT.key} is 0 (random). " +
+ s"Set ${ENGINE_DATA_AGENT_JDBC_URL.key} explicitly.")
+ }
+ s"jdbc:hive2://localhost:$port/default"
Review Comment:
try use the real bound address instead of hardcoded localhost
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]