Github user obermeier commented on a diff in the pull request:
https://github.com/apache/spark/pull/19408#discussion_r142047496
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -981,7 +981,13 @@ private[spark] object Utils extends Logging {
return cached
}
- val indx: Int = hostPort.lastIndexOf(':')
+ val indx: Int =
+ // Interpret hostPort as literal IPv6 address if it contains two ore
more colons
+ // scalastyle:off SingleSpaceBetweenRParenAndLCurlyBrace
+ if (hostPort.matches("(([0-9a-f]*):([0-9a-f]*)){2,}")) -1
--- End diff --
Yes a real parser would be much better!!
I hope the methods will check the input. Like the name resolver...
At this point I thought more about the separation of the port.
I think it is important to check if two colons exists, otherwise this
expression accepts hostnames like abc:123
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]