Skip to content
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

AVRO-2773: [C] Add decimal logical schema #2891

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SahilKang
Copy link
Contributor

AVRO-2773

What is the purpose of the change

These two commits add decimal logical schema support for C: the first commit adds the base layer and the second commit adds higher-level functions to manipulate decimal objects beyond their serialized representation.

Verifying this change

Existing tests were updated and new tests were added to exercise the new functionality.

Documentation

This introduces two new functions which are documented along with the existing functions.

For pre-existing functionality, the underlying bytes and fixed getter/setters can still be used with decimal objects.

@SahilKang
Copy link
Contributor Author

this is an alternative to #843 where the decimal support is added to the value api instead of the deprecated datum api, and decimals are a "first class citizen" in that AVRO_DECIMAL extends the avro_type_t enum

This adds a new AVRO_DECIMAL avro_type_t and uses the existing getters and
setters for value objects: decimal objects are encoded as either bytes or
fixed. For the deprecated datum api, decimal schemas decay to their underlying
bytes or fixed schema: i.e. the legacy api doesn't support logical schemas.

Although this patch adds decimal logical schema support, it does not provide
any decimal support at the "api level": decimal objects are still read and
written as the underlying bytes and fixed objects they were previously.

Signed-off-by: Sahil Kang <sahil.kang@asilaycomputing.com>
Signed-off-by: Sahil Kang <sahilkang@google.com>
@SahilKang
Copy link
Contributor Author

the latest changes link libm, which should resolve the build issues occurring earlier in CI

This patch adds "api level" support for decimal objects: these functions allow
manipulating decimal objects at a higher-level than the underlying bytes and
fixed objects.

Signed-off-by: Sahil Kang <sahil.kang@asilaycomputing.com>
Signed-off-by: Sahil Kang <sahilkang@google.com>
@SahilKang
Copy link
Contributor Author

I was able to run the CI in my own fork and debugged until the latest changes passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant