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

Schema names might not be Java valid identifiers #561

Open
chadparry opened this issue Sep 13, 2024 · 0 comments · May be fixed by #562
Open

Schema names might not be Java valid identifiers #561

chadparry opened this issue Sep 13, 2024 · 0 comments · May be fixed by #562

Comments

@chadparry
Copy link

The FastSerializerGenerator calls Schema.getName() to create temporary variable names when iterating over some arrays and maps. If the element type is a union, then the name created by Schema.UnionSchema.getName() is not a valid Java identifier. The generated code causes compiler errors that look like this:

/tmp/generated16917366869434796488/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_11/Record_GenericSerializer_1168413672.java:97: error: ']' expected
                        CharSequence union[null, string]0 = null;

This is only a problem starting with org.apache.avro:avro:1.12.0, which was released last month: apache/avro@ed2dbd4#diff-22eb7312aa7f632f0f9b1c3f40de619f91a303ee39f43d3a62a338adf745d1efR1289 . (There are other test failures related to logical types that will need to be fixed for full Avro 1.12.0 compatibility, but this was the only issue causing compilation errors.)

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 a pull request may close this issue.

1 participant