Github user JamesRTaylor commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/117#discussion_r41081051
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java ---
@@ -787,15 +789,26 @@ public MutationState execute() throws SQLException {
constantExpression.getDataType(),
column.getDataType(), "expression: "
+ constantExpression.toString() +
" in column " + column);
}
- if (!column.getDataType().isSizeCompatible(ptr,
value, constantExpression.getDataType(),
+ if ((column.getDataType() != PChar.INSTANCE) && //
Char is truncated later
+
!column.getDataType().isSizeCompatible(ptr, value,
constantExpression.getDataType(),
--- End diff --
Is there a reason we wouldn't want to truncate the value for *all* fixed
width types (i.e. column.getDataType().isFixedWidth)? In general, we try not to
match on a particular type, but rather on categories of types. That way, when a
new type gets added, it behaves a bit better.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---