Skip to content

Conversation

@jamespfaulkner
Copy link

What is the purpose of the change

This pull request fixes the issue identified by AVRO-4076.

This is potentially not the best way to do this but I think it at least demonstrates what I think the issue is.
In Schema, we put the result into the context, (ultimately leading to the throw). But we haven't loaded the fields at that point, causing the equality check to fail even if the schemas do match.

Unfortunately I had to change the equals in Protocol.java in order to get the tests to pass. The order of schemas returned by ParseContext.resolveAllSchemas has slightly changed. I'm not sure that the order matters, but if I change ParseContext.resolveAllSchemas to return an unordered collection I get failures in TestIdlReader.runTests.

Verifying this change

This change added tests and can be verified as follows:

  • TestSchema::testParseMultipleFile has been updated to include the redefined Schema scenario.

Documentation

  • Does this pull request introduce a new feature? - no
  • If yes, how is the feature documented? not applicable

@github-actions github-actions bot added the Java Pull Requests for Java binding label Dec 6, 2024
@opwvhk
Copy link
Contributor

opwvhk commented May 29, 2025

Does #3304 fix the issue sufficiently? Is so, I think we can close this PR.

@jamespfaulkner
Copy link
Author

Thanks for the update.

The fix this attempted to achieve was accomplished in Schema::parseRecord by moving the context::put call to after the field loading. That's now done (here in the new PR).

So yep, this can now be closed. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java Pull Requests for Java binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants