uk.ac.starlink.parquet

## Interface Encoder

-     public interface Encoder

  Defines transmission of a java value type to a RecordConsumer for writing to parquet tables.
  Since:
    25 Feb 2021

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addValue(java.lang.Object value, RecordConsumer consumer)` Passes a supplied value representing a cell of this encoder's column to a record consumer.
    `java.lang.String` | `getColumnName()` Returns the name of the column that will be written to the parquet file.
    `Type` | `getColumnType()` Returns the type of the top-level field that will be written.

- - ### Method Detail

    - #### getColumnName

          java.lang.String getColumnName()

      Returns the name of the column that will be written to the parquet file. This is the top-level field, which may correspond to a group type containing lower-level elements, which will be assigned subordinate names automatically.

      Note this name must obey the (undocumented?) parquet field syntax constraints; it seems that roughly it has to look like a java token.

      Returns:
        field name

    - #### getColumnType

          Type getColumnType()

      Returns the type of the top-level field that will be written. This may be a primitive type or a group type.
      Returns:
        column type

    - #### addValue

          void addValue(java.lang.Object value,
                        RecordConsumer consumer)

      Passes a supplied value representing a cell of this encoder's column to a record consumer. This is called between RecordConsumer `startField` and `endField` calls, but if additional structuring calls are required they must be done by this method.
      Parameters:
        `value` - typed value to write
        `consumer` - value consumer