Github user obermeier commented on a diff in the pull request: https://github.com/apache/spark/pull/19408#discussion_r150909772 --- Diff: core/src/test/scala/org/apache/spark/util/UtilsSuite.scala --- @@ -1146,6 +1146,20 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging { } } + test("parseHostPort") { + assert(Utils.parseHostPort("abc:123") === (("abc", 123))) + assert(Utils.parseHostPort("example.com") === (("example.com", 0))) + assert(Utils.parseHostPort("example.com:123") === (("example.com", 123))) + assert(Utils.parseHostPort("127.0.0.1") === (("127.0.0.1", 0))) + assert(Utils.parseHostPort("127.0.0.1:123") === (("127.0.0.1", 123))) + assert(Utils.parseHostPort("2001:db8::1") === (("2001:db8::1", 0))) + assert(Utils.parseHostPort("2001:DB8::1") === (("2001:DB8::1", 0))) + assert(Utils.parseHostPort("2001:dB8::1") === (("2001:dB8::1", 0))) + assert(Utils.parseHostPort("0:0:0:0:0:0:0:0") === (("0:0:0:0:0:0:0:0", 0))) + assert(Utils.parseHostPort("::1") === (("::1", 0))) + assert(Utils.parseHostPort("[::1]:123") === (("[::1]", 123))) + assert(Utils.parseHostPort("[2001:db8:42::1]:123") === (("[2001:db8:42::1]", 123))) --- End diff -- What is the prefered way to handle this kind of parse errors in Spark? Changing the signature of this method to something like :Try[..], :Option ... is no option!? Error log messages? Unchecked Exceptions? ...
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org