You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Zoltan Farkas (Jira)" <ji...@apache.org> on 2020/01/31 17:47:00 UTC

[jira] [Resolved] (AVRO-2057) JsonDecoder.skipChildren does not skip map/records correctly

     [ https://issues.apache.org/jira/browse/AVRO-2057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zoltan Farkas resolved AVRO-2057.
---------------------------------
    Resolution: Implemented

Looks like this was resolved by another chamge

> JsonDecoder.skipChildren does not skip map/records correctly
> ------------------------------------------------------------
>
>                 Key: AVRO-2057
>                 URL: https://issues.apache.org/jira/browse/AVRO-2057
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.2
>            Reporter: Zoltan Farkas
>            Priority: Critical
>
> at https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java#L585
> {code}
>       @Override
>       public JsonParser skipChildren() throws IOException {
>         JsonToken tkn = elements.get(pos).token;
>         int level = (tkn == JsonToken.START_ARRAY || tkn == JsonToken.END_ARRAY) ? 1 : 0;
>         while (level > 0) {
>           switch(elements.get(++pos).token) {
>           case START_ARRAY:
>           case START_OBJECT:
>             level++;
>             break;
>           case END_ARRAY:
>           case END_OBJECT:
>             level--;
>             break;
>           }
>         }
>         return this;
>       }
> {code}
> should be:
> {code}
>       @Override
>       public JsonParser skipChildren() throws IOException {
>         JsonToken tkn = elements.get(pos).token;
>         int level = (tkn == JsonToken.START_ARRAY || tkn == JsonToken.START_OBJECT) ? 1 : 0;
>         while (level > 0) {
>           switch(elements.get(++pos).token) {
>           case START_ARRAY:
>           case START_OBJECT:
>             level++;
>             break;
>           case END_ARRAY:
>           case END_OBJECT:
>             level--;
>             break;
>           }
>         }
>         return this;
>       }
> {code}
> This results in de-serialization failures when the reader schema does not have fields that are present in the serialized object and the writer schema. 



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