ParquetTableParser

com.phasmidsoftware.tableparser.parquet.ParquetTableParser
class ParquetTableParser[R](using converter: ParquetCellConverter[R]) extends TableBuilder[Table[R]]

A TableBuilder for Parquet sources (single files or dataset directories).

Reads a Parquet file or dataset directory into a Table[Row] using ParquetSchemaValidator and the ParquetCellConverter of Row.

Extends TableBuilder directly rather than TableParser, since the Parquet read path does not involve Iterator[String], header rows, or LineParser.

The converter is normally derived (see ParquetCellConverter.derived), for flat and grouped case classes alike: each case class needs only its ColumnHelper.

Type parameters

R

the target case class type.

Value parameters

converter

the ParquetCellConverter of R.

Attributes

Graph
Supertypes
trait TableBuilder[Table[R]]
class Object
trait Matchable
class Any

Members list

Type members

Types

type Row = R

The row type.

The row type.

Attributes

Value members

Concrete methods

def parseParquet(path: Path): Try[Table[Row]]

Parse a single Parquet file into a Table[Row]. Fails if path is a directory; use parseParquetDataset for dataset directories.

Parse a single Parquet file into a Table[Row]. Fails if path is a directory; use parseParquetDataset for dataset directories.

Schema validation is performed before any rows are read. Fails fast with ParquetParserException on any schema mismatch or unsupported type.

Value parameters

path

a java.nio.file.Path to a .parquet file (not a directory).

Attributes

Returns

a Try[Table[Row]].

def parseParquetDataset(path: Path): Try[Table[Row]]

Parse a Parquet dataset directory into a Table[Row]. Dataset directories contain multiple part-*.parquet files. Fails if path is not a directory.

Parse a Parquet dataset directory into a Table[Row]. Dataset directories contain multiple part-*.parquet files. Fails if path is not a directory.

Schema validation is performed before any rows are read. Fails fast with ParquetParserException on any schema mismatch or unsupported type.

Value parameters

path

a java.nio.file.Path to a directory containing part files.

Attributes

Returns

a Try[Table[Row]].

Inherited fields

protected val forgiving: Boolean

If true, individual row failures are logged but do not cause the overall parse to fail.

If true, individual row failures are logged but do not cause the overall parse to fail.

Attributes

Inherited from:
TableBuilder
protected val predicate: Try[Row] => Boolean

Predicate to filter rows. Defaults to including all rows.

Predicate to filter rows. Defaults to including all rows.

Attributes

Inherited from:
TableBuilder