uvashishtha commented on code in PR #29375:
URL: https://github.com/apache/flink/pull/29375#discussion_r4251977616


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java:
##########
@@ -624,8 +627,7 @@ public static String parseUrl(String urlStr, String 
partToExtract, String key) {
             return null;
         }
 
-        Pattern p = Pattern.compile("(&|^)" + Pattern.quote(key) + "=([^&]*)");
-        Matcher m = p.matcher(query);
+        Matcher m = QUERY_PARAM_PATTERN_CACHE.get(key).matcher(query);

Review Comment:
   Thanks @raminqaf for the review. For this, my only hesitation was the 
per-record string build and a hash for the lookup, but it's probably not much 
compared to the other operations we already do in this case so I applied your 
suggestion, given both you and @snuyanzin recommended re-use. 
   
   PTAL.



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

Reply via email to