Skip to content

AVRO-4133: Support default enum value in Protobuf to Avro #3367

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zenfenan
Copy link

@zenfenan zenfenan commented May 1, 2025

What is the purpose of the change

This PR creates enum Schema with the default symbol when converting Protobuf descriptor to Avro schema.

Verifying this change

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

Documentation

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

@github-actions github-actions bot added the Java Pull Requests for Java binding label May 1, 2025
@zenfenan zenfenan changed the title [AVRO-4133] Support default enum value in Protobuf to Avro AVRO-4133: Support default enum value in Protobuf to Avro May 1, 2025
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.

@zenfenan
Copy link
Author

zenfenan commented May 2, 2025

@martin-g Could you also merge this?

@nandorKollar
Copy link
Contributor

@zenfenan Would you mind add an extra test case to demonstrate this change? It seems that at the moment nothing tests enum schema conversions, I think TestProbuf would be a good place for an extra test case. It appears, that we didn't handle default tags in the past either, like the example in test.proto: optional A enum = 16 [default = Z];. Probably we should raise a separate Jira to handle default tags properly.

Copy link
Contributor

@opwvhk opwvhk left a comment

Choose a reason for hiding this comment

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

The change itself looks good, but it lacks a test case.
Preferably with the link @martin-g provided: https://protobuf.dev/programming-guides/proto3/#default

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