difin commented on code in PR #5729:
URL: https://github.com/apache/hive/pull/5729#discussion_r2029439302


##########
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/HiveLockObject.java:
##########
@@ -85,7 +85,9 @@ public HiveLockObjectData(String data) {
       lockMode = elem[2];
       queryStr = StringInternUtils.internIfNotNull(elem[3]);
       if (elem.length >= 5) {
-        clientIp = elem[4];
+        String prefix = queryId + ":" + lockTime + ":" + lockMode + ":" + 
queryStr + ":";
+        // The client IP is the suffix after the 4th colon, this can be IPv6 
with colons
+        clientIp = data.substring(data.indexOf(prefix) + prefix.length());

Review Comment:
   Right, it is always 0.
   Refactored this part to have `String[] elem = data.split(":", 5);`, so this 
won't be needed.



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to