-
Notifications
You must be signed in to change notification settings - Fork 111
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
Adds support for reading binary Ion 1.1 timestamps. #640
Conversation
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.
There's a few small things that look like they might be typos, but otherwise it looks good.
int month = 0; | ||
int day = 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.
Should these default to 1?
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.
Sure, it doesn't end up mattering because Timestamp does its own defaulting, but it looks better with them set to valid values.
int month = 0; | ||
int day = 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.
Same as above. Should these default to 1?
public static final int NANOSECOND_SCALE = 9; | ||
public static final int MAX_MICROSECONDS = 999999; | ||
public static final int MICROSECOND_SCALE = 6; | ||
public static final short MAX_MILLISECONDS = 999; |
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.
Any particular reason why this one is a short
instead of an int
?
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.
Nope, changed
…o address PR feedback.
…s more tests for numeric types.
Description of changes:
Short and long-form, as of the current revision of the Ion 1.1 spec. Reading the fractional component of long-form timestamps will change slightly if amazon-ion/ion-docs#286 is merged.
I copied the CsvSource parameters from IonEncoder_1_1Test. Ideally we'd be able to share these more easily, but a
static final String[]
isn't accepted by JUnit. Leaving that for future improvement. Additional test coverage should probably come from ion-tests.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.