-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC4J-562 Odd unsigned decimals incorrect scale #666
Conversation
@rpastrana please review. @jchambers-ln @drealeed FYI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpmcmu a couple of comments.
self.udec16 := (REAL)(random() % unique_values); | ||
self.udec15 := (REAL)(random() % unique_values); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a corresponding test to verify these odd len decimals are correctly read?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpastrana Yes, tests in DFSReadWriteTest read those generated datasets, write them back, and then compare the datasets against the generated datasets for correctness.
@@ -830,7 +830,11 @@ private BigDecimal getUnsignedDecimal(int numDigits, int precision, int dataLen) | |||
BigDecimal ret = new BigDecimal(0); | |||
|
|||
int idx = 0; | |||
int curDigit = numDigits - 1; | |||
int curDigit = numDigits; | |||
if ((numDigits % 2) == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not entirely obvious to me why this logic is needed, perhaps an inline comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, added a comment and squashed
- Corrected BinaryRecordReader unsigned decimal parse code - Updated ECL test datasets to include odd precision decimal values Signed-off-by: James McMullan [email protected]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: James McMullan [email protected]
Type of change:
Checklist:
Testing: