uk.ac.starlink.parquet

## Class ParquetStarTable

- java.lang.Object
- - uk.ac.starlink.table.AbstractStarTable
  - - uk.ac.starlink.parquet.ParquetStarTable

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, StarTable
  Direct Known Subclasses:
    CachedParquetStarTable, SequentialParquetStarTable

      public abstract class ParquetStarTable
      extends AbstractStarTable

  Partial StarTable implementation based on a Parquet file. This class provides metadata handling and preparation for data reading, but does not implement actual data access methods.
  Since:
    25 Feb 2021

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ValueInfo` | `CREATEDBY_INFO` Parameter metadata for parquet creation info.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParquetStarTable(IOSupplier<ParquetFileReader> pfrSupplier)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getColumnCount()` Returns the number of columns in this table.
    `ColumnInfo` | `getColumnInfo(int icol)` Returns the object describing the data in a given column.
    `ColumnReadStore` | `getColumnReadStore(PageReadStore pageStore, MessageType schema)` Gets a ColumnReadStore from a PageReadStore.
    `InputColumn<?>` | `getInputColumn(int icol)` Returns the input column that can be used to read a given column of this table.
    `ParquetFileReader` | `getParquetFileReader()` Returns a reader for this table's underlying file.
    `long` | `getRowCount()` Returns the number of rows in this table, if known.
    `MessageType` | `getSchema()` Returns the schema of the the parquet file.

    - ### Methods inherited from class uk.ac.starlink.table.AbstractStarTable

      `checkedLongToInt, close, getCell, getColumnAuxDataInfos, getName, getParameters, getRow, getRowAccess, getRowSequence, getRowSplittable, getURL, isRandom, setName, setParameters, setURL`

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

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

    - ### Methods inherited from interface uk.ac.starlink.table.StarTable

      `getParameterByName, setParameter`

- - ### Field Detail

    - #### CREATEDBY_INFO

          public static final ValueInfo CREATEDBY_INFO

      Parameter metadata for parquet creation info.

  - ### Constructor Detail

    - #### ParquetStarTable

          public ParquetStarTable(IOSupplier<ParquetFileReader> pfrSupplier)
                           throws java.io.IOException

      Constructor.
      Parameters:
        `pfrSupplier` - access to parquet data file
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### getColumnCount

          public int getColumnCount()

      Description copied from interface: `StarTable`
      Returns the number of columns in this table.
      Specified by:
        `getColumnCount` in interface `StarTable`
      Specified by:
        `getColumnCount` in class `AbstractStarTable`
      Returns:
        the number of columns

    - #### getRowCount

          public long getRowCount()

      Description copied from interface: `StarTable`
      Returns the number of rows in this table, if known. If the number of rows cannot be (easily) determined, a value of -1 will be returned.
      Specified by:
        `getRowCount` in interface `StarTable`
      Specified by:
        `getRowCount` in class `AbstractStarTable`
      Returns:
        the number of rows, or -1

    - #### getColumnInfo

          public ColumnInfo getColumnInfo(int icol)

      Description copied from interface: `StarTable`
      Returns the object describing the data in a given column.
      Specified by:
        `getColumnInfo` in interface `StarTable`
      Specified by:
        `getColumnInfo` in class `AbstractStarTable`
      Parameters:
        `icol` - the column for which header information is required
      Returns:
        a ValueInfo object for column `icol`

    - #### getParquetFileReader

          public ParquetFileReader getParquetFileReader()
                                                 throws java.io.IOException

      Returns a reader for this table's underlying file.
      Returns:
        parquet file reader
      Throws:
        `java.io.IOException`

    - #### getSchema

          public MessageType getSchema()

      Returns the schema of the the parquet file.
      Returns:
        parquet schema

    - #### getColumnReadStore

          public ColumnReadStore getColumnReadStore(PageReadStore pageStore,
                                                    MessageType schema)

      Gets a ColumnReadStore from a PageReadStore.
      Parameters:
        `pageStore` - page store
        `schema` - schema for required data; this may for instance define only a subset of available columns
      Returns:
        column store

    - #### getInputColumn

          public InputColumn<?> getInputColumn(int icol)

      Returns the input column that can be used to read a given column of this table.
      Parameters:
        `icol` - column index
      Returns:
        input column