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

Raymie Stata commented on AVRO-2400:
------------------------------------

I don't have a horse in this race, other than getting the definition of schema 
resolution and the schema-compatibility check to agree.  Whether 1.9.x goes 
with the stricter (SchemaCompatibility) definition or the looser (schema 
resolution) approach doesn't much matter to me.  Happy to let the larger 
community decide.

That said, it doesn't seem like the larger community is likely to weight in on 
this topic.  As a result, I think we're obligated to go with what we believe 
most people in the community are assuming.  From this perspective, it seems 
like many more people are dependent on what the Java schema-resolution logic in 
1.8.x is doing, which would make it the de facto standard (any evidence to the 
contrary?).  Thus, I'd lean towards bringing the 1.9.x behavior of 
schema-resolution and SchemaCompatibility in line with the 1.8.x behavior or 
schema-resolution.  But definitely open to counter arguments!

> Avro 1.9.0 can't resolve schemas that can be resolved in 1.8.2
> --------------------------------------------------------------
>
>                 Key: AVRO-2400
>                 URL: https://issues.apache.org/jira/browse/AVRO-2400
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Jacob Tolar
>            Priority: Blocker
>             Fix For: 1.10.0, 1.9.1
>
>
> The failure occurs in ResolvingGrammarGenerator when reader and writer schema 
> have an array of records with different full names (e.g. different 
> namespace). 
> {code:java}
> Exception in thread "main" java.lang.ClassCastException: 
> org.apache.avro.Resolver$ReaderUnion cannot be cast to 
> org.apache.avro.Resolver$Container{code}
> Avro 1.8.2 allowed this behavior but it now fails in 1.9.0. Looking at the 
> jiras and code, I don't believe this was intentional ( AVRO-2275,  
> [https://github.com/apache/avro/commit/39d959e1c6a1f339f03dab18289e47f27c10be7f]
>   ).
>  
> It looks like there were some attempts to keep compatibility ( 
> [https://github.com/apache/avro/blob/branch-1.9/lang/java/avro/src/main/java/org/apache/avro/Resolver.java]
>  , e.g. see the commented out check for w.getFullName() in resolve()) but 
> this case was missed.
>  
> See this simple example to reproduce. 
> [https://gist.github.com/jacobtolar/c88d43ab4e8767227891e5cdc188ffad]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to