Class SkipConsumer

java.lang.Object
org.apache.arrow.adapter.avro.consumers.SkipConsumer
All Implemented Interfaces:
AutoCloseable, Consumer

public class SkipConsumer extends Object implements Consumer
Consumer which skip (throw away) data from the decoder.
  • Constructor Details

    • SkipConsumer

      public SkipConsumer(SkipFunction skipFunction)
  • Method Details

    • consume

      public void consume(org.apache.avro.io.Decoder decoder) throws IOException
      Description copied from interface: Consumer
      Consume a specific type value from avro decoder and write it to vector.
      Specified by:
      consume in interface Consumer
      Parameters:
      decoder - avro decoder to read data
      Throws:
      IOException - on error
    • addNull

      public void addNull()
      Description copied from interface: Consumer
      Add null value to vector by making writer position + 1.
      Specified by:
      addNull in interface Consumer
    • setPosition

      public void setPosition(int index)
      Description copied from interface: Consumer
      Set the position to write value into vector.
      Specified by:
      setPosition in interface Consumer
    • getVector

      public FieldVector getVector()
      Description copied from interface: Consumer
      Get the vector within the consumer.
      Specified by:
      getVector in interface Consumer
    • close

      public void close() throws Exception
      Description copied from interface: Consumer
      Close this consumer when occurs exception to avoid potential leak.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Consumer
      Throws:
      Exception
    • resetValueVector

      public boolean resetValueVector(FieldVector vector)
      Description copied from interface: Consumer
      Reset the vector within consumer for partial read purpose.
      Specified by:
      resetValueVector in interface Consumer
      Returns:
      true if reset is successful, false if reset is not needed.
    • skippable

      public boolean skippable()
      Description copied from interface: Consumer
      Indicates whether the consumer is type of SkipConsumer.
      Specified by:
      skippable in interface Consumer