Phoenix 572 Truncate CHAR with max length on upsert#117
Phoenix 572 Truncate CHAR with max length on upsert#117d9liang wants to merge 4 commits intoapache:masterfrom d9liang:PHOENIX-572
Conversation
There was a problem hiding this comment.
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.
|
Thanks for the patch, @d9liang - I reviewed and left you some minor feedback. Overall, it looks very good. One other thing to check (and add tests for) is other code paths that insert data: namely UPSERT SELECT (on client-side and server-side) and CSV bulk load (which goes through a similar code path as UPSERT VALUES, so you might already be covered there, not sure). This would ensure that we're consistently truncating fixed width types in all cases. |
This transaction truncate string to the CHAR max length value on upsert. A test case is added and passed. Please review.