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 and Description
    --- | ---
    `static class` | `AvroColumnReader.Params` Parameters for reading an Avro column file.

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `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.util.Iterator

      `forEachRemaining`

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

      `forEach, spliterator`

- - ### Constructor Detail

    - #### AvroColumnReader

          public AvroColumnReader(AvroColumnReader.Params params)
                           throws IOException

      Construct a reader for a file.
      Throws:
        `IOException`

  - ### Method Detail

    - #### getFileSchema

          public 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 `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.