AVRO-4332: [java] Add support for enum default values in IDL serialization

IdlUtils.writeSchema did not emit the enum default when serializing a
schema to IDL, even though IdlReader parses it. As a result, an enum
default was silently dropped when round-tripping a schema through IDL.

Append "= <default>;" after the enum body when the schema has a default,
matching the IDL grammar (RBrace defaultSymbol=enumDefault?), and add
tests covering the with-default, without-default and write-then-parse
round-trip cases.
3 files changed
tree: 10daca2c22b21a4561ea0da0ba9c33bd52a434de
  1. .devcontainer/
  2. .github/
  3. .mvn/
  4. doc/
  5. lang/
  6. share/
  7. .asf.yaml
  8. .editorconfig
  9. .gitattributes
  10. .gitignore
  11. .yamllint.yml
  12. BUILD.md
  13. build.sh
  14. composer.json
  15. DIST_README.txt
  16. docker-compose.yml
  17. LICENSE.txt
  18. NOTICE.txt
  19. pom.xml
  20. README.md
README.md

[!IMPORTANT]
The Rust SDK is moving to https://github.com/apache/avro-rs. Please use it for new issues and pull requests!

Apache Avro™

Current CI status (Github servers)

test c test c# test c++ test java test javascript test perl test ruby test python test php

Current CodeQL status

codeql c# codeql java codeql javascript codeql python


Apache Avro™ is a data serialization system.

Learn more about Avro, please visit our website at:

https://avro.apache.org/

To contribute to Avro, please read:

https://cwiki.apache.org/confluence/display/AVRO/How+To+Contribute

You can use devcontainers to develop Avro:

  • Open in Visual Studio Code
  • Open in Github Codespaces

Trademark & logos

Apache®, Apache Avro and the Apache Avro airplane logo are trademarks of The Apache Software Foundation.

The Apache Avro airplane logo on this page has been designed by Emma Kellam for use by this project.