paul-rogers commented on a change in pull request #2044: DRILL-7678: Update
Yauaa Dependency
URL: https://github.com/apache/drill/pull/2044#discussion_r401835648
##########
File path:
contrib/udfs/src/main/java/org/apache/drill/exec/udfs/UserAgentFunctions.java
##########
@@ -46,11 +46,14 @@
DrillBuf outBuffer;
@Workspace
- nl.basjes.parse.useragent.UserAgentAnalyzerDirect uaa;
+ nl.basjes.parse.useragent.UserAgentAnalyzer uaa;
+
+ @Workspace
+ java.util.List<String> allFields;
public void setup() {
- uaa =
nl.basjes.parse.useragent.UserAgentAnalyzerDirect.newBuilder().dropTests().hideMatcherLoadStats().build();
- uaa.getAllPossibleFieldNamesSorted();
+ uaa = org.apache.drill.exec.udfs.UserAgentAnalyzerProvider.getInstance();
+ allFields = uaa.getAllPossibleFieldNamesSorted();
Review comment:
Thinking this through... Drill is multi-threaded. We can have, say, 20
threads all running the same query, evaluating the same expression. Having the
list here seems thread-safe. I wonder, however, is the list of fields
essentially static? Seems to be, there are no parameters passed to the
instance. If so, does it make sense to store the field list in the provider so
we don't have to build it for every thread of every query?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services