phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maryann Xue (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-3568) Handle row timestamp columns properly in phoenix calcite
Date Fri, 06 Jan 2017 20:13:58 GMT

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

Maryann Xue commented on PHOENIX-3568:
--------------------------------------

Thank you very much for logging and debugging this issue, [~rajeshbabu]! So which file/method
should your suggested fix live in?

> Handle row timestamp columns properly in phoenix calcite
> --------------------------------------------------------
>
>                 Key: PHOENIX-3568
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3568
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Rajeshbabu Chintaguntla
>              Labels: calcite
>
> If we don't pass row time stamp column value phoenix pass 0 initially while preparing
Mutations the the value will be replaced with mutation timestamp. But with Phoenix Calcite
we are passing null so the test cases related to row timestamp are failing with the following
errors.
> {noformat}
> java.sql.SQLException: java.sql.SQLException: ERROR 201 (22000): Illegal data. Expected
length of at least 8 bytes, but had 0
> 	at org.apache.phoenix.end2end.UpsertSelectIT.testRowTimestampColWithViewsIndexesAndSaltedTables(UpsertSelectIT.java:1125)
> Caused by: java.lang.RuntimeException: java.sql.SQLException: ERROR 201 (22000): Illegal
data. Expected length of at least 8 bytes, but had 0
> 	at org.apache.phoenix.end2end.UpsertSelectIT.testRowTimestampColWithViewsIndexesAndSaltedTables(UpsertSelectIT.java:1125)
> Caused by: java.sql.SQLException: ERROR 201 (22000): Illegal data. Expected length of
at least 8 bytes, but had 0
> 	at org.apache.phoenix.end2end.UpsertSelectIT.testRowTimestampColWithViewsIndexesAndSaltedTables(UpsertSelectIT.java:1125)
> {noformat}
> I think as a fix while preparing bind expressions if it's null we need to prepare proper
literal expression. So that the remaining things will be taken care by Phoenix itself.
> {noformat}
>         for (int i = 0; i< projects.size() ; i++) {
>             RexNode project = projects.get(i);
>             if(table.getRowTimestampColPos()!= -1 && ((i + specialColumns) ==
table.getRowTimestampColPos()) && project.toString() == "null") {
>                 PColumn pColumn = table.getPKColumns().get(table.getRowTimestampColPos());
>                 LiteralParseNode literal = UpsertCompiler.getNodeForRowTimestampColumn(pColumn);
>                 try {
>                     exprs.add(LiteralExpression.newConstant(literal.getValue(), pColumn.getDataType(),
pColumn.getSortOrder(), Determinism.ALWAYS));
>                 } catch (SQLException e) {
>                     throw new RuntimeException(e);
>                 }
>             } else {
>                 exprs.add(CalciteUtils.toExpression(project, implementor));
>             }
>         }
>         TupleProjector tupleProjector = implementor.project(exprs);
> {noformat}



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

Mime
View raw message