You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2016/01/15 17:11:39 UTC

[jira] [Comment Edited] (PHOENIX-2593) Ensure all built-ins have required constructors

    [ https://issues.apache.org/jira/browse/PHOENIX-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15101953#comment-15101953 ] 

James Taylor edited comment on PHOENIX-2593 at 1/15/16 4:10 PM:
----------------------------------------------------------------

Thanks, [~Dumindux]. New unit test looks good. Does it pass? What about TO_NUMBER? I'd recommend also adding a check for a no arg constructor as that's required if run on the sever side. We might need to whitelist a few built-ins that we know won't run there, though.

I've renamed the JIRA to make it more general, so please go ahead and continue using the same one. 


was (Author: jamestaylor):
Thanks, [~Dumindux]. You can use the same JIRA. Does the unit test pass? What about TO_NUMBER?

> Ensure all built-ins have required constructors
> -----------------------------------------------
>
>                 Key: PHOENIX-2593
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2593
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: Dumindu Buddhika
>             Fix For: 4.7.0
>
>         Attachments: PHOENIX-2593.patch, PHOENIX-2593_unit_test.patch
>
>
> Here's how to repro:
> {code}
> 0: jdbc:phoenix:localhost> create table a1 (k varchar primary key, v varchar[]);
> No rows affected (2.722 seconds)
> 0: jdbc:phoenix:localhost> select to_date(v[1]) from a1;
> java.lang.RuntimeException: java.lang.NoSuchMethodException: org.apache.phoenix.expression.function.ToDateFunction.<init>(java.util.List)
> 	at org.apache.phoenix.expression.function.ScalarFunction.clone(ScalarFunction.java:44)
> 	at org.apache.phoenix.expression.visitor.CloneExpressionVisitor.visitLeave(CloneExpressionVisitor.java:106)
> 	at org.apache.phoenix.expression.visitor.ReplaceArrayFunctionExpressionVisitor.visitLeave(ReplaceArrayFunctionExpressionVisitor.java:44)
> 	at org.apache.phoenix.expression.visitor.ReplaceArrayFunctionExpressionVisitor.visitLeave(ReplaceArrayFunctionExpressionVisitor.java:26)
> 	at org.apache.phoenix.expression.function.ScalarFunction.accept(ScalarFunction.java:58)
> 	at org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:462)
> 	at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:545)
> 	at org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:495)
> 	at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:201)
> 	at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:158)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:399)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:373)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:266)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:261)
> 	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:260)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1349)
> 	at sqlline.Commands.execute(Commands.java:822)
> 	at sqlline.Commands.sql(Commands.java:732)
> 	at sqlline.SqlLine.dispatch(SqlLine.java:808)
> 	at sqlline.SqlLine.begin(SqlLine.java:681)
> 	at sqlline.SqlLine.start(SqlLine.java:398)
> 	at sqlline.SqlLine.main(SqlLine.java:292)
> Caused by: java.lang.NoSuchMethodException: org.apache.phoenix.expression.function.ToDateFunction.<init>(java.util.List)
> 	at java.lang.Class.getConstructor0(Class.java:2892)
> 	at java.lang.Class.getConstructor(Class.java:1723)
> 	at org.apache.phoenix.expression.function.ScalarFunction.clone(ScalarFunction.java:42)
> 	... 22 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)