You can translate the question and the replies:

MEDIAN gives an error

While calculating median. I am receiving the following error. ** [GROUPBY] [ERROR] java.lang.reflect.InvocationTargetException Received exception with message 'java.lang.reflect.InvocationTargetException'** The logs are as follows: *ERROR 2021-05-31T09:38:05.943 com.denodo.vdb.contrib.aggregatefunction.CustomAggregateFunctionMEDIAN [] - class java.lang.Float cannot be cast to class java.lang.Double (java.lang.Float and java.lang.Double are in module java.base of loader 'bootstrap') java.lang.ClassCastException: class java.lang.Float cannot be cast to class java.lang.Double (java.lang.Float and java.lang.Double are in module java.base of loader 'bootstrap') at com.denodo.vdb.contrib.aggregatefunction.CustomAggregateFunctionMEDIAN.medianDouble(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.contrib.aggregatefunction.CustomAggregateFunctionMEDIAN.medianFloat(Unknown Source) [denodo-vdp-server.jar:8.0.0] at jdk.internal.reflect.GeneratedMethodAccessor4668.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at com.denodo.common.custom.util.CustomFunctionsUtil.executeMethod(CustomFunctionsUtil.java:123) [denodo-commons-custom.jar:8.0.0] at com.denodo.vdb.catalog.view.aggregatefunction.CustomFunctionAdapterAggregateFunction.execute(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.catalog.view.aggregatefunction.CustomFunctionAdapterAggregateFunction.resultPhase(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.catalog.view.function.AggregateFunctionValue.execute(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.catalog.view.function.FunctionCAST.execute(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.catalog.view.function.FunctionValue.checkI18nAndExecute(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.engine.wrapper.vdb.GroupByFilter.a3(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.engine.wrapper.vdb.GroupByFilter.doAsyncRunFilter(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.engine.wrapper.vdb.AbstractAsyncFilter.asyncRunFilter(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.engine.wrapper.vdb.AbstractAsyncFilter.runFilter(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.engine.wrapper.vdb.CombineDataAccess.doRun(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.engine.thread.AbstractWorker.run(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.engine.thread.WorkWrapper.a3(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.engine.thread.ReusableThread.d3(Unknown Source) [denodo-vdp-server.jar:8.0.0] at com.denodo.vdb.engine.thread.ReusableThread.run(Unknown Source) [denodo-vdp-server.jar:8.0.0] ERROR 2021-05-31T09:38:05.944 com.denodo.vdb.engine.wrapper.vdb.GroupByFilter [] - com.denodo.vdb.catalog.view.function.ExecuteFunctionException: java.lang.reflect.InvocationTargetException*
user
31-05-2021 03:59:12 -0400

1 Answer

Hi, An InvocationTargetException is typically a wrapper around a different exception. In this case, it seems the underlying error is in the first two lines of the logs you shared, where a Float can’t be cast to a Double in the custom aggregate function. You can refer to the similar [Q&A thread](https://community.denodo.com/answers/question/details?questionId=9064u000000CepvAAC&title=Median+failing+in+denodo+7) for more information. Hope this helps!
Denodo Team
01-06-2021 15:28:15 -0400
You must sign in to add an answer. If you do not have an account, you can register here