[ 
https://issues.apache.org/jira/browse/DRILL-7678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17073097#comment-17073097
 ] 

ASF GitHub Bot commented on DRILL-7678:
---------------------------------------

paul-rogers commented on 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]


> Update Yauaa dependency
> -----------------------
>
>                 Key: DRILL-7678
>                 URL: https://issues.apache.org/jira/browse/DRILL-7678
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Niels Basjes
>            Priority: Major
>
> The Yauaa useragent parsing library has a new release.
> Also a few changes and small optimizations are needed to make it work.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to