Skip to content

PartitionReader

PartitionReader is an abstraction of partition readers (that PartitionReaderFactory creates for reading partitions in columnar or row-based fashion).

Generic Interface

PartitionReader is a generic interface with the following Java definition:

public interface PartitionReader<T>

PartitionReader uses T as the name of the type parameter.

Generic Types

Find out more on generic types in The Java Tutorials.

Contract

Next Record

T get()

Retrieves the current record

Used when:

  • DataSourceRDD is requested to compute a partition
  • FilePartitionReader is requested to get the current record
  • PartitionReaderWithPartitionValues is requested to get the current record

Proceeding to Next Record

boolean next()

Proceeds to next record if available (true) or false

Used when:

  • DataSourceRDD is requested to compute a partition
  • FilePartitionReader is requested to proceed to next record if available
  • PartitionReaderWithPartitionValues is requested to proceed to next record if available

Implementations

  • EmptyPartitionReader
  • FilePartitionReader
  • PartitionedFileReader
  • PartitionReaderFromIterator
  • PartitionReaderWithPartitionValues
  • PartitionRecordReader
  • others