parse_url(x,HOST) is not returning a valid Hostname. Try the example given in summary above.
Looking at the src code of https://github.com/cloudera/Impala/blob/8567b51f8c38bd389a338c761242a316d8ffe5c8/be/src/util/url-parser.cc
we should be searching for a "/" in string and then look for a "@"; however acc to src code, we search for a "@" && then look for a "/"
As a workaround the HOST could be parsed using a regex.