Seung-Hyun Cheong created AVRO-3698:
---------------------------------------

             Summary: [Java] SpecificData.getClassName must replace reserved 
words
                 Key: AVRO-3698
                 URL: https://issues.apache.org/jira/browse/AVRO-3698
             Project: Apache Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.11.1
            Reporter: Seung-Hyun Cheong
             Fix For: 1.11.2


[Java] SpecificData.getClassName must replace reserved words

 

When makes Java Class, SpecificCompiler replaces reserved words like public, 
new, etc...

[https://github.com/apache/avro/blob/master/lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java#L1129]

 

For example, if the namespace of a schema is {*}db.public.table{*}, then the 
package name of the generated Java Class, made by SpecificCompiler, is 
{*}db.public$.table{*}.

 

But when deserializes an Avro Record to a SpecificRecord, 
SpecificData.getClassName returns {*}db.pulic.table.Name{*}.

 

So, it can't find a class by name from SpecificData.getClassName.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to