Package org.apache.trevni.avro

# Class AvroColumnReader<D>

java.lang.Object
org.apache.trevni.avro.AvroColumnReader<D>

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Iterable<D>`, `Iterator<D>`

public class AvroColumnReader<D> extends Object implements Iterator<D>, Iterable<D>, Closeable
Read files written with `AvroColumnWriter`. A subset of the schema used for writing may be specified when reading. In this case only columns of the subset schema are read.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`AvroColumnReader.Params`
Parameters for reading an Avro column file.

## Constructor Summary

Constructors
Constructor
Description
`AvroColumnReader(AvroColumnReader.Params params)`
Construct a reader for a file.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`org.apache.avro.Schema`
`getFileSchema()`
Return the schema for data in this file.
`long`
`getRowCount()`
Return the number of rows in this file.
`boolean`
`hasNext()`
`Iterator<D>`
`iterator()`
`D`
`next()`
`void`
`remove()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Methods inherited from interface java.util.Iterator

`forEachRemaining`

## Constructor Details

### AvroColumnReader

public AvroColumnReader(AvroColumnReader.Params params) throws IOException
Construct a reader for a file.

Throws:
  `IOException`

## Method Details

### getFileSchema

public org.apache.avro.Schema getFileSchema()
Return the schema for data in this file.

### iterator

public Iterator<D> iterator()

Specified by:
  `iterator` in interface `Iterable<D>`

### hasNext

public boolean hasNext()

Specified by:
  `hasNext` in interface `Iterator<D>`

### getRowCount

public long getRowCount()
Return the number of rows in this file.

### next

public D next()

Specified by:
  `next` in interface `Iterator<D>`

### remove

public void remove()

Specified by:
  `remove` in interface `Iterator<D>`

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Throws:
  `IOException`