Skip to content

Phoenix 572 Truncate CHAR with max length on upsert#117

Open
d9liang wants to merge 4 commits intoapache:masterfrom
d9liang:PHOENIX-572
Open

Phoenix 572 Truncate CHAR with max length on upsert#117
d9liang wants to merge 4 commits intoapache:masterfrom
d9liang:PHOENIX-572

Conversation

@d9liang
Copy link

@d9liang d9liang commented Sep 28, 2015

This transaction truncate string to the CHAR max length value on upsert. A test case is added and passed. Please review.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@JamesRTaylor
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants