[
https://issues.apache.org/jira/browse/PHOENIX-2010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14565881#comment-14565881
]
Rajeshbabu Chintaguntla commented on PHOENIX-2010:
--------------------------------------------------
Yes for both the questions [~giacomotaylor].
{code}
stmt.execute("create function mysum(INTEGER, INTEGER CONSTANT
defaultValue='10' minvalue='1' maxvalue='15' ) returns INTEGER as
'org.apache.phoenix.end2end."+MY_SUM_CLASS_NAME+"' using jar "
+ "'"+util.getConfiguration().get(DYNAMIC_JARS_DIR_KEY) +
"/myjar2.jar"+"'");
ResultSet rs = stmt.executeQuery("select mysum(k,12) from t4");
assertTrue(rs.next());
assertEquals(13, rs.getInt(1));
rs = stmt.executeQuery("select mysum(k) from t4");
assertTrue(rs.next());
assertEquals(11, rs.getInt(1));
{code}
> Properly validate number of arguments passed to the functions in
> FunctionParseNode#validate
> -------------------------------------------------------------------------------------------
>
> Key: PHOENIX-2010
> URL: https://issues.apache.org/jira/browse/PHOENIX-2010
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.4.0
> Reporter: Rajeshbabu Chintaguntla
> Assignee: Rajeshbabu Chintaguntla
> Fix For: 5.0.0, 4.5.0, 4.4.1
>
> Attachments: PHOENIX-2010.patch
>
>
> Getting ArrayIndexOutOfBoundsException if we pass more arguments than actual
> number arguments. And if we pass lesser number of arguments then getting null
> values. It's not problem for built-in functions because we are using function
> name and number arguments combination key for lookup built-in functions in
> the the map. It's problem for UDF functions.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)