Summary
This article explains the issues related to conflicting functions with similar signatures that can occur during a Dremio upgrade and how to resolve them.
Reported Issue
When running `dremio-admin upgrade` the user may see an error indicating there are conflicting functions.
Relevant Versions
All releases
Troubleshooting Steps
The user may observe an error such as below:
Exception in thread "main" java.lang.AssertionError: Conflicting functions with similar signature found. Func Name: truncate, Class name: com.dremio.exec.expr.fn.impl.GMathFunctions$TruncateFloat4 Class name: com.dremio.exec.expr.fn.impl.GMathFunctions$TruncateFloat4
at com.dremio.exec.expr.fn.FunctionRegistry.<init>(FunctionRegistry.java:96)
at com.dremio.exec.expr.fn.FunctionImplementationRegistry.<init>(FunctionImplementationRegistry.java:63)
at com.dremio.dac.cmd.ReflectionRecommender.<clinit>(ReflectionRecommender.java:83)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.dremio.common.scanner.persistence.ScanResult.getAnnotatedClasses(ScanResult.java:175)
at com.dremio.dac.cmd.AdminCommandRunner.main(AdminCommandRunner.java:41)
Cause
This problem is often caused when the preparation for an upgrade has mistakenly left two or more jar files with different versions in place. This can sometimes happen if for example the user has untarred the Dremio install into the same directory path (for tarball installs) or some other automated or manual action that is used to move newer versions of Dremio install artefacts into place. With the example above the error was seen when a customer upgraded from 19.1 to 19.7. The customer had these two files:
dremio-sabot-kernel-19.1.0-202112161327220321-60e92fcc.jar
dremio-sabot-kernel-19.7.0-202204292306080431-217ee044.jar
To illustrate why this is a problem you can see that inside the jar file there could potentially be two of the same class files
% unzip -t dremio-sabot-kernel-19.1.0-202112161327220321-60e92fcc.jar | grep -E "GMathFunctions.*TruncateFloat4" testing:
com/dremio/exec/expr/fn/impl/GMathFunctions$TruncateFloat4.class OK
Steps to Resolve
Check the `/jars` directory for any duplicates and remove any older versions
Tips & Tricks
N/A
Best Practices
N/A
Recommendations
N/A
FAQ
N/A
Additional Resources
N/A