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-4040: [java] @AvroInternal annotation for getSchema() and getSpecificData() methods #3124

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

Conversation

bgalek
Copy link

@bgalek bgalek commented Aug 27, 2024

What is the purpose of the change

This pull request introduces @AvroInternal annotation interface that serves only to identify the semantics of being something internal/avro specific.

Thanks to this indicator annotation, class processors can ignore those avro-specific fields not coming from user defined schema.

Fixes https://issues.apache.org/jira/browse/AVRO-4040

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Documentation

I think we could mention this interface in some docs.

@github-actions github-actions bot added the Java Pull Requests for Java binding label Aug 27, 2024
@bgalek bgalek changed the title AVRO-4040: [avro, java] @AvroInternal annotation for getSchema() and getSpecificData() methods AVRO-4040: [java] @AvroInternal annotation for getSchema() and getSpecificData() methods Aug 27, 2024
@bgalek
Copy link
Author

bgalek commented Aug 28, 2024

I've fixed spotless error, so build should pass now ;)

@bgalek
Copy link
Author

bgalek commented Aug 29, 2024

…fic/AvroInternal.java

Co-authored-by: Oscar Westra van Holthe - Kind <[email protected]>
@bgalek
Copy link
Author

bgalek commented Sep 10, 2024

Any chances for merge? :)

@bgalek
Copy link
Author

bgalek commented Sep 19, 2024

@opwvhk hi, do we have any ETA for this PR?

@bgalek
Copy link
Author

bgalek commented Oct 3, 2024

@opwvhk any updates?

@bgalek
Copy link
Author

bgalek commented Oct 7, 2024

@opwvhk 👋 ?
or maybe @belugabehr? :)

@bgalek
Copy link
Author

bgalek commented Oct 8, 2024

anyone? :)

Copy link
Member

@martin-g martin-g left a comment

Choose a reason for hiding this comment

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

I am OK with the changes but I'd prefer adding a test case(s) that uses reflection to verify that the two methods have this new annotation for classes generated from Record, Fixed and Enum schemas.

@bgalek
Copy link
Author

bgalek commented Oct 9, 2024

@martin-g sure thing, I'll add those tests - will you help me with merging this afterwards? :)

@martin-g
Copy link
Member

martin-g commented Oct 9, 2024

will you help me with merging this afterwards?

I am trying to not step on my Java mates' toes but I think I could help you here ! ;-)

@bgalek
Copy link
Author

bgalek commented Oct 28, 2024

@martin-g I've gone through the repo test suites, and it seems that relevant tests that I've updated are already covering my case since they compare an avro-generated Java class with its java-compiled counterpart.
If there is a testuite that I could extend - I would need some directions. Can avro team help me ship this feature in 2024? :)

@martin-g
Copy link
Member

Which test(s) cover the Enum and Fixed cases ?

@bgalek
Copy link
Author

bgalek commented Oct 29, 2024

AFAIK lang/java/avro/src/test/java/org/apache/avro/TypeEnum.java is beeing compared with class generated from avro schema

@bgalek
Copy link
Author

bgalek commented Oct 29, 2024

maybe you could point me to an example test that I missed that I could extend/blueprint?

@martin-g
Copy link
Member

I don't use Java (in general) for several years now ...
I really have no idea how those classes are being used/tested. And I don't have the time to investigate ...

I just wanted to see a new test that introduces some record, enum and fixed schemas, generates .java classes for them and then uses reflection to verify the existence of the new annotation.

I'm afraid you will have to wait someone from the Java team to take a look.

@bgalek
Copy link
Author

bgalek commented Oct 29, 2024

@martin-g I get it; thank you for your dedication to help!
Is there an user that I should mention/ping about this PR? :)

@bgalek
Copy link
Author

bgalek commented Nov 14, 2024

any chances for update here?

@martin-g
Copy link
Member

Is there an user that I should mention/ping about this PR? :)

Everyone from the team is already notified, so there is no need of personal pings.
I cannot say why there is no reaction. Maybe lack of time, maybe something else ...

@bgalek
Copy link
Author

bgalek commented Nov 19, 2024

@martin-g I get it, but even "we won't make it this year" answer is better than no answer ;)
I also did not find any clean workaround for my problem (only "semi-bad" ones like harcoding avro field/method names in springdoc...)

@bgalek
Copy link
Author

bgalek commented Dec 10, 2024

please, can anyone check this small pr?

@bgalek
Copy link
Author

bgalek commented Dec 17, 2024

is there anyone?

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.

4 participants