[
https://issues.apache.org/jira/browse/PHOENIX-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gabriel Reid resolved PHOENIX-451.
----------------------------------
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.
> col expr for desc column is not handled correctly in upsert statements
> ----------------------------------------------------------------------
>
> Key: PHOENIX-451
> URL: https://issues.apache.org/jira/browse/PHOENIX-451
> Project: Phoenix
> Issue Type: Task
> Reporter: Simon Toens
> Assignee: Simon Toens
> Labels: bug
>
> CREATE TABLE FOO (pk VARCHAR NOT NULL PRIMARY KEY DESC)
> UPSERT INTO FOO (pk) VALUES (to_char(10000))
> This ends up writing the col value to HBase without inverting the bits first.
>
> Note that this works fine for literals (ie without to_char) The bug here is
> in the expression evaluation code path.
> See UpsertCompiler around line 432. Probably coerceBytes bytes should take
> the ColumnModifier as an argument so that the bit inversion can happen in
> PDataType.
> Locally, adding this code right after the call to coerceBytes fixes the issue:
> if (column.getColumnModifier() != literalExpression.getColumnModifier()) {
> column.getColumnModifier().apply(byteValue, byteValue, 0,
> byteValue.length);
> }
> @ivarley ran into this issue.
--
This message was sent by Atlassian JIRA
(v6.2#6252)