phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Soldatov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-4747) UDF's integer parameter doens't accept negative constant.
Date Mon, 21 May 2018 22:18:00 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-4747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Soldatov updated PHOENIX-4747:
-------------------------------------
    Attachment: PHOENIX-4747-IT.patch

> UDF's integer parameter doens't accept negative constant.
> ---------------------------------------------------------
>
>                 Key: PHOENIX-4747
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4747
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.14.0
>            Reporter: Sergey Soldatov
>            Priority: Major
>         Attachments: PHOENIX-4747-IT.patch
>
>
> If UDF has an integer parameter and we provide a negative constant it fails with 
> {noformat}
> org.apache.phoenix.schema.ArgumentTypeMismatchException: ERROR 203 (22005): Type mismatch.
expected: [INTEGER] but was: BIGINT at ADDTIME argument 2
> 	at org.apache.phoenix.parse.FunctionParseNode.validateFunctionArguement(FunctionParseNode.java:214)
> 	at org.apache.phoenix.parse.FunctionParseNode.validate(FunctionParseNode.java:193)
> 	at org.apache.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:331)
> 	at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visitLeave(ProjectionCompiler.java:700)
> 	at org.apache.phoenix.compile.ProjectionCompiler$SelectClauseVisitor.visitLeave(ProjectionCompiler.java:585)
> 	at org.apache.phoenix.parse.FunctionParseNode.accept(FunctionParseNode.java:86)
> 	at org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:412)
> 	at org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:561)
> 	at org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:507)
> 	at org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:193)
> 	at org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:153)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:490)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:456)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:302)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:291)
> 	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:290)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:283)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1830)
> 	at sqlline.Commands.execute(Commands.java:822)
> 	at sqlline.Commands.sql(Commands.java:732)
> 	at sqlline.SqlLine.dispatch(SqlLine.java:813)
> 	at sqlline.SqlLine.begin(SqlLine.java:686)
> 	at sqlline.SqlLine.start(SqlLine.java:398)
> 	at sqlline.SqlLine.main(SqlLine.java:291)
> {noformat}
> That happens because negative constants are parsed as integer value * -1L, so the result
is long. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message