[ https://issues.apache.org/jira/browse/PHOENIX-655?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gabriel Reid resolved PHOENIX-655. ---------------------------------- Resolution: Fixed Bulk resolve of closed issues imported from GitHub. This status was reached by first re-opening all closed imported issues and then resolving them in bulk. > use phoenix upsert record for hbase,when data type not match, throw exception > directly on the client > ---------------------------------------------------------------------------------------------------- > > Key: PHOENIX-655 > URL: https://issues.apache.org/jira/browse/PHOENIX-655 > Project: Phoenix > Issue Type: Task > Affects Versions: 2.1.1 > Reporter: zhangbingxiang > Assignee: mujtaba > > [version] > phoenix-2.0.1.tar.gz > [detail] > 0: jdbc:phoenix:10.18.40.69,10.18.40.130> upsert into my_schema.my_table > values(1,'li',to_date(19800101)); > Error: ERROR 203 (22005): Type mismatch. expected: [VARCHAR] but was: INTEGER > at TO_DATE argument 1 (state=22005,code=0) > 0: jdbc:phoenix:10.18.40.69,10.18.40.130> upsert into my_schema.my_table > values(1,'li',to_date('1980-01-01')); > java.lang.IllegalStateException: to_date('1980-01-01)' did not match expected > date format of 'yyyy-MM-dd HH:mm:ss'. > at > com.salesforce.phoenix.expression.function.ToDateFunction.evaluate(ToDateFunction.java:106) > at > com.salesforce.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:330) > at > com.salesforce.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:50) > at > com.salesforce.phoenix.parse.FunctionParseNode.accept(FunctionParseNode.java:94) > at > com.salesforce.phoenix.compile.UpsertCompiler.compile(UpsertCompiler.java:485) > at > com.salesforce.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(PhoenixStatement.java:228) > at > com.salesforce.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.optimizePlan(PhoenixStatement.java:233) > at > com.salesforce.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.executeUpdate(PhoenixStatement.java:217) > at > com.salesforce.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.execute(PhoenixStatement.java:210) > at > com.salesforce.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:944) > at sqlline.SqlLine$Commands.execute(SqlLine.java:3673) > at sqlline.SqlLine$Commands.sql(SqlLine.java:3584) > at sqlline.SqlLine.dispatch(SqlLine.java:821) > at sqlline.SqlLine.begin(SqlLine.java:699) > at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:441) > at sqlline.SqlLine.main(SqlLine.java:424) > [suggestion] > catch the exception and print laconic error info, not including stack info. -- This message was sent by Atlassian JIRA (v6.2#6252)