Skip to content

Conversation

@andrewsmartin
Copy link
Contributor

Scala's BigDecimal class has some stateful fields that result in an encoding that isn't determined by only the value. This causes problems in a framework like Apache Beam where serialized bytes are used to perform mutation checking on values (see spotify/scio#1170).

This PR addresses the problem by registering a deterministic BigDecimalSerializer, which simply encodes the underlying Java BigDecimal instance, which is immutable.

@CLAassistant
Copy link

CLAassistant commented May 21, 2018

CLA assistant check
All committers have signed the CLA.

@johnynek johnynek merged commit e774819 into twitter:develop May 22, 2018
@johnynek
Copy link
Collaborator

Thanks for the PR!

gdiet added a commit to testbench-cs-imbus/chill that referenced this pull request Jun 15, 2018
PR twitter#312 registered the serializer for BigDecimal with ID 15, moving all serialization IDs from 15 on one up. This breaks compatibility for projects using chill for long term persistence - see com.twitter.chill.RegistrationIdsSpec which failed just for that reason.

In this commit, the registration of BigDecimal is moved to ID 144 (the end of the list) and the RegistrationIdsSpec is updated accordingly.
johnynek added a commit that referenced this pull request Jun 15, 2018
@nevillelyh
Copy link
Collaborator

Hi, just checking if there's any plan to make a release? The last one was 5 months old. Thanks!

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.

4 participants