-
Notifications
You must be signed in to change notification settings - Fork 229
Fixed decimal encoding in a backwards compatible way #302
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
base: master
Are you sure you want to change the base?
Conversation
|
@rockwotj another review when you get a chance. The CI failed but it seems to be an unrelated issue |
logical_type.go
Outdated
| } | ||
|
|
||
| // Check if bytes look like ASCII decimal string (backwards compat) | ||
| if looksLikeASCIIDecimal(bs) { |
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.
I do not think this is backwards compatible, are we sure there is never valid encoding of a number that would look like valid ascii? I don’t believe so. We need an option for this unless you have some proof this is never wrong
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.
You're right... I have added an option and reduced the scope of the heuristic for determining that the bytes are a valid ascii..
... Or alternatively, we could have a compatibility mode (by default) which can be overridden to false so the encoding is modified.
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.
@rockwotj ok decided to go with fully backwards compatible option and NOT try to recover badly encoded data (since it's imperfect logic). So enabling the spec compliant option will switch to the new mode...
… use cases (i.e. has a `.`)
Description
Opt-in spec compliant encoding
1. Add new codec option
EnableDecimalBinarySpecCompliantEncodingtoCodecOptionin codec.gofalse(legacy behavior)2. Conditionally use spec-compliant encoding
true: Use proper two's complement binary encoding and human-readable textualfalse: Use legacy ASCII string encoding (original behavior)Issue Reference
#296