ParquetSchemaValidator

com.phasmidsoftware.tableparser.parquet.ParquetSchemaValidator

Validates a Parquet MessageType schema against the columns which a ParquetCellConverter reads, prior to reading any rows.

The columns come from the converter (see ParquetCellConverter.columns), so this supports both flat case classes (all fields map directly to Parquet columns) and grouped case classes (some fields are sub-case-classes, each of which maps its own fields to Parquet columns via its own ColumnHelper).

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def validate[Row](schema: MessageType, converter: ParquetCellConverter[Row]): Try[Unit]

Validates a Parquet MessageType schema against the columns read by the converter of Row.

Validates a Parquet MessageType schema against the columns read by the converter of Row.

Checks:

  • Every column has a corresponding column in the Parquet schema (after ColumnHelper name mapping is applied).
  • Every matched column has a supported Parquet type (via ParquetTypeMapper), which maps to the type of its parameter.
  • Any OPTIONAL Parquet column must map to an Option[T] parameter.

Columns present in the Parquet schema but absent from Row are silently ignored, consistent with existing CSV behaviour.

Type parameters

Row

the target case class type.

Value parameters

converter

the ParquetCellConverter of Row.

schema

the MessageType read from the Parquet file footer.

Attributes

Returns

Success(()) if valid, Failure(ParquetParserException) if not.