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

fix(java): Move schema caching to unsafe trait to avoid issues when using non-inferred schema. #1944

Merged
merged 6 commits into from
Nov 19, 2024

Conversation

wywen
Copy link
Contributor

@wywen wywen commented Nov 18, 2024

What does this PR do?

This PR removes the java specific ExtField class from the schema and moves the extData mechanism to the internal UnsafeTrait class. This is necessary because ExtField is only created internally from inferSchema method used by java, and we would potentially import or derive schemas from other sources (e.g XLANG, handwritten schema, arrow-native source) -- those schemas will be incompatible when we attempt to retrieve the cached schema. Removing schema-caching will fix the issue, but create allocations, so after some discussion, we decided to move the mechanism to the internal UnsafeTrait class.

This implementation makes changes internal API:

  • Derived classes from UnsafeTrait need to initialize the extData cache and define the number of extData slots needed.
  • The internal getStruct method needs to define which slot we use to retrieve extData.

Other:

  • REVERTED: pom.xml for fury-format will automatically run tests with appropriate --add-opens flag for arrow

Related issues

Does this PR introduce any user-facing change?

N/A

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

@wywen wywen requested a review from chaokunyang as a code owner November 18, 2024 14:49
Copy link
Collaborator

@chaokunyang chaokunyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chaokunyang chaokunyang merged commit 5b22ccd into apache:main Nov 19, 2024
37 checks passed
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.

2 participants