Closed cgivre closed 4 years ago
Hi Charles, Thanks for bringing this up. I had a close look at the stacktraces you provided and I also had a look at the dependencies of yauaa.
Running this mvn dependency:tree -Dincludes=commons-logging
did not result in anything for the core yauaa library and resulted in only these transitive dependencies coming from drill-java-exec (1.17.0):
[INFO] ---------------< nl.basjes.parse.useragent:yauaa-drill >----------------
[INFO] Building Yauaa : UDF : Apache Drill : Function 5.16-SNAPSHOT [11/26]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ yauaa-drill ---
[INFO] nl.basjes.parse.useragent:yauaa-drill:jar:5.16-SNAPSHOT
[INFO] \- org.apache.drill.exec:drill-java-exec:jar:1.17.0:provided
[INFO] \- org.apache.hadoop:hadoop-common:jar:3.2.1:provided
[INFO] \- commons-logging:commons-logging:jar:1.1.3:provided
[INFO]
[INFO] ------------< nl.basjes.parse.useragent:yauaa-drill-tests >-------------
[INFO] Building Yauaa : UDF : Apache Drill : Tests 5.16-SNAPSHOT [12/26]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ yauaa-drill-tests ---
[INFO] nl.basjes.parse.useragent:yauaa-drill-tests:jar:5.16-SNAPSHOT
[INFO] \- org.apache.drill.exec:drill-java-exec:jar:1.17.0:test
[INFO] \- org.apache.hadoop:hadoop-common:jar:3.2.1:test
[INFO] \- commons-logging:commons-logging:jar:1.1.3:test
[INFO]
Looking more closely at the stacktrace you provided I noticed that the error I find there is completely different:
Assignment conversion not possible from type "nl.basjes.parse.useragent.AbstractUserAgentAnalyzerDirect" to type "nl.basjes.parse.useragent.UserAgentAnalyzerDirect"
Which sounds correct since AbstractUserAgentAnalyzerDirect is the superclass of UserAgentAnalyzerDirect.
The way the Builder pattern for Yauaa was constructed has been changed between 5.13 and 5.14 so that users from other languages (like Scala) can use it a lot easier.
This builder uses generics to run the builder in such a way that subclasses do not need to re-implement all builder methods with an 'empty' dummy.
This it looks very likely that this change is (or is triggering) the real problem. My current hunch is that the Drill code compilation subsystem does not like this builder setup.
I'll have a closer look if I can find what is going wrong.
I notice in the Drill code that you are using the UserAgentAnalyzerDirect
(which does not do caching) instead of the UserAgentAnalyzer
(which does caching).
Is there a reason for that?
Perhaps Drill is already doing caching because this function is deterministic (i.e. always the same result)?
I have found a workaround. I'm currently releasing a new Yauaa version. After that I'll put up a pull request for Drill.
@cgivre I just opened a pull request for you to review https://github.com/apache/drill/pull/2044
Closing this as the pull request seems to be an accepted solution.
Describe the bug As of version 5.13,
yauaa
breaks the Apache Drill UDFs. The issue is thatcommons-logging
is a banned dependency in Drill. I attempted to exclude it in thepom.xml
as shown below.However, this results in the errors below in the unit tests. Version 5.13 is the last version which works without issues. I attempted to redirect the logs by directly by following the instructions here 1 but that didnt' seem to work either. Any suggestions?
Component where the bug happens [ ] Core analyzer [X] UDF : Drill [ ] Other
To Reproduce Steps or code fragment to reproduce the behavior:
pom.xml
file to use the latest version and attempt to build.Expected behavior UDF Should work
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.