ParquetCellConverter

com.phasmidsoftware.tableparser.parquet.ParquetCellConverter
See theParquetCellConverter companion trait

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

inline def apply[T]: ParquetCellConverter[T]

Method to get the ParquetCellConverter of T: its own, if there is one; otherwise, if T is a case class, a derived one.

Method to get the ParquetCellConverter of T: its own, if there is one; otherwise, if T is a case class, a derived one.

Type parameters

T

the type of the result.

Attributes

Returns

a ParquetCellConverter[T].

inline def derived[T](using m: ProductOf[T]): ParquetCellConverter[T]

Method to derive a ParquetCellConverter[T] for a case class T, so that case class T(...) derives ParquetCellConverter works. This replaces the converter2 ... converter8 methods (and the reflection) of 1.x, and has no limit on the number of fields.

Method to derive a ParquetCellConverter[T] for a case class T, so that case class T(...) derives ParquetCellConverter works. This replaces the converter2 ... converter8 methods (and the reflection) of 1.x, and has no limit on the number of fields.

Each field is read from the column whose name is given by ColumnHelper[T] for that field's name. The field names come from the Mirror (at compile time), in declaration order. A field whose type is itself a case class (a "grouped" field), and which has no ParquetCellConverter of its own, is derived in turn: its fields are read from the same (flat) row, using its own ColumnHelper.

NOTE: as for CellParser.derived, don't derive the converter of a case class defined inside a method in a companion object that you write for it.

Type parameters

T

a case class.

Value parameters

m

the Mirror of T.

Attributes

Returns

a ParquetCellConverter[T].

def primitive[T](clazz: Class[_])(f: (SimpleGroup, String) => T): ParquetCellConverter[T]

Method to create a ParquetCellConverter for a primitive column.

Method to create a ParquetCellConverter for a primitive column.

Type parameters

T

the type of the result.

Value parameters

clazz

the Scala type which the column must map to (see ParquetTypeMapper).

f

a function which gets the value of the named column from a SimpleGroup.

Attributes

Returns

a ParquetCellConverter[T].

Givens

Givens

Converter for Option[T] fields. Returns None if the field has no value in this row, Some(value) otherwise. T must be read from a single column (an optional case class is not supported).

Converter for Option[T] fields. Returns None if the field has no value in this row, Some(value) otherwise. T must be read from a single column (an optional case class is not supported).

Attributes