uvashishtha commented on PR #29375:
URL: https://github.com/apache/flink/pull/29375#issuecomment-5985508208

   > > The same caching mechanism exists for the REGEXP_PATTERN_CACHE, 
URL_CACHE in this same file to solve the same problem, I think.
   > 
   > so why do we duplicate then instead of reuse?
   > 
   > also creating a test class because of 1 test does not look like a good 
approach
   
   Agreed on the test class. There is already a `StringFunctionsITCase` which 
covers the cases for this function, so I removed the test class.
   
   On the reuse, 
   1. `REGEXP_PATTERN_CACHE` compiles its key as-is, so reusing it means 
building "(&|^)" + Pattern.quote(key) + "=([^&]*)" on every call just to look 
it up. A cache keyed by the parameter name avoids that..
   
   2. `URL_CACHE` produces a URL type for a key, so that is out of scope.
   
   Let me know what you think.


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