Class ColumnProjection
java.lang.Object
dev.hardwood.schema.ColumnProjection
Specifies which columns to read from a Parquet file.
Column projection allows reading only a subset of columns, improving performance by skipping I/O, decoding, and memory allocation for unneeded columns.
Usage examples:
// Read all columns (default)
ColumnProjection.all()
// Read specific columns
ColumnProjection.columns("id", "name", "address")
// For nested schemas, dot notation selects nested fields
ColumnProjection.columns("address.city") // specific nested field
ColumnProjection.columns("address") // parent group and all children
-
Method Summary
Modifier and TypeMethodDescriptionstatic ColumnProjectionall()Returns a projection that includes all columns.static ColumnProjectionReturns a projection that includes only the specified columns.Returns the set of column names to project, or null if all columns are projected.booleanReturns true if this projection includes all columns.
-
Method Details
-
all
Returns a projection that includes all columns. -
columns
Returns a projection that includes only the specified columns.For flat schemas, use simple column names. For nested schemas:
"address"- selects the parent group and all its children"address.city"- selects only a specific nested field
- Parameters:
names- the column names to project- Returns:
- a projection containing only the specified columns
- Throws:
IllegalArgumentException- if no column names are provided
-
projectsAll
public boolean projectsAll()Returns true if this projection includes all columns. -
getProjectedColumnNames
-