Andrew Prudhomme created FLINK-11915:
----------------------------------------

             Summary: DataInputViewStream skip returns wrong value
                 Key: FLINK-11915
                 URL: https://issues.apache.org/jira/browse/FLINK-11915
             Project: Flink
          Issue Type: Bug
            Reporter: Andrew Prudhomme


The flink-core:org.apache.flink.api.java.typeutils.runtime.DataInputViewStream 
overrides the InputSteam skip function. This function should be returning the 
actual number of bytes skipped, but there is a bug which makes it return a 
lower value.

The fix should be something simple like:
{code:java}
-  return n - counter - inputView.skipBytes((int) counter);
+  return n - (counter - inputView.skipBytes((int) counter));
{code}
For context, I ran into this when trying to decode an Avro record where the 
writer schema had fields not present in the reader schema. The decoder would 
attempt to skip the unneeded data in the stream, but would throw an 
EOFException because the return value was wrong.



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

Reply via email to