taiyang-li commented on code in PR #9179:
URL: https://github.com/apache/incubator-gluten/pull/9179#discussion_r2022240304


##########
cpp-ch/local-engine/Functions/SparkParseURL.cpp:
##########
@@ -380,6 +380,21 @@ struct SparkExtractURLHost
         if (userinfo_delim_pos && userinfo_delim_pos < end)
         {
             host = DB::getURLHost(userinfo_delim_pos + 1, end - 
userinfo_delim_pos);
+            /// url pattern like 
'protocol://[username:password@]hostname[:port]/path[?query][#fragment]', when 
host return empty,
+            /// we can get the first delimiter of path, the sub-string between 
user info and path delimiter is the host string.
+            if (host.empty())
+            {
+                DB::Pos first_path_delim_pos = 
find_first_symbols<'/'>(userinfo_delim_pos + 1, end);
+                if (first_path_delim_pos && first_path_delim_pos - 
userinfo_delim_pos - 1 > 0)
+                {
+                    DB::Pos host_port_delim_pos = 
find_first_symbols<':'>(userinfo_delim_pos + 1, first_path_delim_pos);
+                    host = std::string_view(userinfo_delim_pos + 1, 
host_port_delim_pos - userinfo_delim_pos - 1);
+                }
+                else
+                {
+                    host = std::string_view{};

Review Comment:
   let host as it be. It looks redundant here



-- 
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]

Reply via email to