Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-11915

DataInputViewStream skip returns wrong value

    XMLWordPrintableJSON

Details

    Description

      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:

      -  return n - counter - inputView.skipBytes((int) counter);
      +  return n - (counter - inputView.skipBytes((int) counter));
      

      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.

      Attachments

        Issue Links

          Activity

            People

              SleePy Biao Liu
              aprudhomme Andrew Prudhomme
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m