You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Kevin A Shaw (Jira)" <ji...@apache.org> on 2020/01/14 20:57:00 UTC

[jira] [Comment Edited] (AVRO-2682) Compiled schema cannot find symbol readFieldOrderIfDiff (Java)

    [ https://issues.apache.org/jira/browse/AVRO-2682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17015382#comment-17015382 ] 

Kevin A Shaw edited comment on AVRO-2682 at 1/14/20 8:56 PM:
-------------------------------------------------------------

Further experimentation has shown that, if I:
 * remove the {{@Override}} decorator from the three methods ({{hasCustomCoders}}, {{customEncode}} and {{customDecode}}), and
 * change the method call in {{customDecode}} from {{readFieldOrderIfDiff()}} to\{{ readFieldOrder()}}

That the code compiles and seems to run correctly.  While this is unquestionable a kludge, this at least allows me to move forward with testing.

That said, it is still a pain to have to modify the generated-source every time that I have to recompile the Schema and hope some solution can be found to avoid this.


was (Author: hephaestus):
Further experimentation has shown that, if I:
 * remove the {{@Override}} decorator from the three methods ({{hasCustomCoders}}, {{customEncode}} and {{customDecode}}), and
 * change the method call in {{customDecode}} from {{readFieldOrderIfDiff()}} to{{ readFieldOrder()}}

That the code compiles and seems to run correctly.  While I can't say that I know much about the operation of Avro, this seems to at least allows me to move forward.

> Compiled schema cannot find symbol readFieldOrderIfDiff (Java)
> --------------------------------------------------------------
>
>                 Key: AVRO-2682
>                 URL: https://issues.apache.org/jira/browse/AVRO-2682
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.9.0, 1.10.0, 1.9.1, 1.9.2
>         Environment: OS: MacOS 10.15.2
> IDE: IntelliJ 2019.3.1 with Java9
> Avro compiler: avro-tools 1.9.1
> Libraries (via Maven): org.apache.avro:avro:1.9.1 and org.apache.avro:avro-maven-plugin:1.9.1 (though several other versions have been tested as well)
>            Reporter: Kevin A Shaw
>            Priority: Blocker
>         Attachments: ActivityRecord2.avsc, ResolvingDecoder.java, SpecificRecordBase.java, Test.java, Untitled.png
>
>
> We are experimenting with Avro to generate data files for a large data repo we are building.
> Hence, we created a small test Avro Schema (see attached `ActivityRecord2.avsc`).  We compiled it with `avro-tools` using the following command:
> {{avro-tools compile schema ActivityRecord2.avsc ~/foobar/src/main/java}}
> The resulting file, `Test.java` (attached) will not compile in IntelliJ with Java9.
> There are four messages (a screen shot of the source with highlighting is attached: `Untitled.jpg`).
> The errors are:
>  
> {code:java}
>   Error:(279, 3) java: method does not override or implement a method from a supertype
>   Error:(281, 3) java: method does not override or implement a method from a supertype
>   Error:(288, 3) java: method does not override or implement a method from a supertype
>   Error:(291, 51) java: cannot find symbol
>        symbol: method readFieldOrderIfDiff()
>        location: variable in of type org.apache.avro.io.ResolvingDecoder
> {code}
> I have inspected the source for these to classes (ResolvingDecoder and SpecificRecordBase), decompiled them from the Avro .jar library and stored the resulting java source.  These two files are attached and they definitely do not have the required symbols present.  These are from the 1.9.1 release.
> I have used Maven to test several versions of the Jar Libraries (as listed above), including Avro 1.8, 1.9 and 1.10, but with no improvements.  I get the same error for all of them.
> Is there something that we are going wrong here?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)