You can translate the question and the replies:

Custom Function With Annotation

Denodo : 7 Hi , I am trying the sample code from "Developing Custom Function with Annotation".Note that I only want to delegate to underlying database . My code looks like this : package com.denodo.vdp.demo.function.custom; import com.denodo.common.custom.annotations.CustomElement; import com.denodo.common.custom.annotations.CustomElementType; import com.denodo.common.custom.annotations.CustomExecutor; import com.denodo.common.custom.annotations; @CustomElement(type = CustomElementType.VDPFUNCTION, name = "MAX_VALUE") public class CustomFunctionMaxNumber { @CustomExecutor(implementation = false, delegationPatterns = { @DelegationPattern(databaseName = "sqlserver", pattern = "MAXIMUM_N($0, $1, $2)"), @DelegationPattern(databaseName = "oracle", databaseVersions = { "10g", "11g" }, pattern = "TOP_N($0, $1, $2)") }) } While compiling I am getting error . Wondering whether I can get a proper code like this as we have sample custom functions . ( I have successfully implemented the 3 sample java code given as example . so there is no issue with the environment ) .
25-03-2020 12:54:19 -0400

1 Answer

Hi When you add DelegationPattern annotation in your code, ensure that the expression you specify in the pattern parameter exists in the underlying data source. In your code, the MAXIMUM_N and TOP_N function should exist in the SQLserver and Oracle databases. These functions are mentioned in the section [Developing Custom Functions that Can Be Delegated to a Database]( just as an example and they don’t exist in real refer to the [Footnotes]( for more information. Hope this helps.
Denodo Team
26-03-2020 03:33:03 -0400
You must sign in to add an answer. If you do not have an account, you can register here