[
https://issues.apache.org/jira/browse/DERBY-3063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526118
]
Kristian Waagan commented on DERBY-3063:
----------------------------------------
I have two initial questions regarding this issue:
a) Is it worth the extra code to support functions with more than one argument?
- Support for one or two can be implemented using static final variables.
- Support for an arbitrary number of arguments must be done by creating the
needed structures in a loop.
b) Is it possible to get Derby to "automatically" allow for valid conversions?
For instance, JDBC defines POWER(number, power) where 'power' is an
integer. StrictMath has pow(double,double). How do I get Derby to convert the
integer 'power' to a 'double' when passing the value to the Java function? (I'm
in the context of system functions defined in a table - see DERBY-475).
Question a) arises because right now I don't see many functions that actually
requires more than one argument (ATAN2 is one of them). Can these few functions
easily be added and implemented in a different way?
I'm attaching a sample patch adding support for functions with arbitrary number
of arguments. Optimizations can easily be done for the common case of one or
two arguments.
> Extend the system function mechanism to support functions with multiple
> arguments
> ---------------------------------------------------------------------------------
>
> Key: DERBY-3063
> URL: https://issues.apache.org/jira/browse/DERBY-3063
> Project: Derby
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 10.4.0.0
> Reporter: Kristian Waagan
> Priority: Minor
>
> Extend the existing functionality for adding Java functions to SQL to support
> functions with multiple arguments.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.