ColumnWriterOptions#
- public class ColumnWriterOptions#
Per column settings for writing Parquet/ORC files.
The native also uses the same “column_in_metadata” for both Parquet and ORC.
Subclassed by ai.rapids.cudf.ColumnWriterOptions.ListColumnWriterOptions, ai.rapids.cudf.ColumnWriterOptions.StructColumnWriterOptions
Field Summary
Constructor Summary
Method Summary
Return the child columnOptions for this column.
Return if the column can have null values.
Return the Parquet field ID for this column.
Return the precision for this column.
Returns true if a Parquet field ID was set on this column.
Returns true if this column is a binary (byte array) column in Parquet.
Return if the column can have null values.
Returns true if the writer is expected to write timestamps in INT96.
Creates a ListBuilder for column called ‘name’.
Creates a ListBuilder for column called ‘name’.
listBuilder(String name, boolean isNullable, int parquetFieldId)Creates a ListBuilder for column called ‘name’ with a Parquet field ID set on the list itself.
mapColumn(String name, ColumnWriterOptions key, ColumnWriterOptions value)Deprecated. Add a Map Column to the schema.
mapColumn(String name, ColumnWriterOptions key, ColumnWriterOptions value, Boolean isNullable)Add a Map Column to the schema.
Add a Map Column to the schema with a Parquet field ID set on the outer list.
Creates a StructBuilder for column called ‘name’.
Creates a StructBuilder for column called ‘name’.
structBuilder(String name, boolean isNullable, int parquetFieldId)Creates a StructBuilder for column called ‘name’.
Static Fields
- public static int UNKNOWN_PRECISION#
Protected Fields
- protected ColumnWriterOptions[] childColumnOptions#
Constructors
- public ColumnWriterOptions(
- String columnName,
- boolean isTimestampTypeInt96,
- int precision,
- boolean isNullable
- public ColumnWriterOptions(
- String columnName,
- boolean isTimestampTypeInt96,
- int precision,
- boolean isNullable,
- int parquetFieldId
Methods
- public boolean isNullable()#
Return if the column can have null values.
- public int getPrecision()#
Return the precision for this column.
- public boolean isTimestampTypeInt96()#
Returns true if the writer is expected to write timestamps in INT96.
- public ColumnWriterOptions[] getChildColumnOptions()#
Return the child columnOptions for this column.
- public boolean isBinary()#
Returns true if this column is a binary (byte array) column in Parquet.
- public boolean hasParquetFieldId()#
Returns true if a Parquet field ID was set on this column.
- public int getParquetFieldId()#
Return the Parquet field ID for this column.
The value is only meaningful when
hasParquetFieldId()returns true.
Static Methods
- public static ColumnWriterOptions mapColumn(
- String name,
- ColumnWriterOptions key,
- ColumnWriterOptions value
Add a Map Column to the schema.
Maps are List columns with a Struct named ‘key_value’ with a child named ‘key’ and a child named ‘value’. The caller of this method doesn’t need to worry about this as this method will take care of this without the knowledge of the caller.
Note: This method always returns a nullabe column, cannot return non-nullable column. Do not use this, use the next function with the parameter
isNullable.
- public static ColumnWriterOptions mapColumn(
- String name,
- ColumnWriterOptions key,
- ColumnWriterOptions value,
- Boolean isNullable
Add a Map Column to the schema.
Maps are List columns with a Struct named ‘key_value’ with a child named ‘key’ and a child named ‘value’. The caller of this method doesn’t need to worry about this as this method will take care of this without the knowledge of the caller.
Note: If this map column is a key of another map, should pass isNullable = false. e.g.: map1(map2(int, int), int) the map2 should be non-nullable.
- Parameters:
isNullable – is the returned map nullable.
- public static ColumnWriterOptions mapColumn(
- String name,
- ColumnWriterOptions key,
- ColumnWriterOptions value,
- boolean isNullable,
- int parquetFieldId
Add a Map Column to the schema with a Parquet field ID set on the outer list.
Maps are List columns with a Struct named ‘key_value’ with a child named ‘key’ and a child named ‘value’. The caller of this method doesn’t need to worry about this as this method will take care of this without the knowledge of the caller.
- Parameters:
isNullable – is the returned map nullable. Primitive
boolean(notBoolean) so anullcan’t slip through and trigger an unexpectedNullPointerExceptionwhen forwarded tolistBuilder(String, boolean, int).parquetFieldId – the Parquet field ID to attach to the outer (list) column.
- public static ListBuilder listBuilder(String name)#
Creates a ListBuilder for column called ‘name’.
- public static ListBuilder listBuilder(String name, boolean isNullable)#
Creates a ListBuilder for column called ‘name’.
- public static ListBuilder listBuilder(
- String name,
- boolean isNullable,
- int parquetFieldId
Creates a ListBuilder for column called ‘name’ with a Parquet field ID set on the list itself.
- public static StructBuilder structBuilder(
- String name,
- boolean isNullable
Creates a StructBuilder for column called ‘name’.
- public static StructBuilder structBuilder(
- String name,
- boolean isNullable,
- int parquetFieldId
Creates a StructBuilder for column called ‘name’.
- public static StructBuilder structBuilder(String name)#
Creates a StructBuilder for column called ‘name’.
Protected Methods
- protected boolean[] getFlatBooleans(
- boolean[] ret,
- ByteArrayProducer producer
- protected int[] getFlatInts(int[] ret, IntArrayProducer producer)#
- protected abstract static class AbstractStructBuilder<T extends AbstractStructBuilder, V extends ColumnWriterOptions> extends NestedBuilder<T, V>#
Subclassed by ai.rapids.cudf.CompressionMetadataWriterOptions.Builder< T extends Builder, V extends CompressionMetadataWriterOptions >
Constructor Summary
Builder specific to build a Struct meta.
AbstractStructBuilder(String name, boolean isNullable, int parquetFieldId)Fields inherited from class
ai.rapids.cudf.ColumnWriterOptions.NestedBuilder:children,hasParquetFieldId,isNullable,name,parquetFieldIdMethods inherited from class
ai.rapids.cudf.ColumnWriterOptions.NestedBuilder:build,withBinary,withBinaryColumn,withColumn,withColumns,withDecimal,withDecimalColumn,withListColumn,withMapColumn,withNonNullableColumns,withNullableColumns,withNullableDecimalColumn,withNullableTimestampColumn,withStructColumn,withTimestamp,withTimestampColumnConstructors
Protected Constructors
- protected AbstractStructBuilder()#
- public static abstract class NestedBuilder<T extends NestedBuilder, V extends ColumnWriterOptions>#
Field Summary
Constructor Summary
Builder specific to build a Struct meta.
NestedBuilder(String name, boolean isNullable, int parquetFieldId)Method Summary
Protected Fields
- protected List<ColumnWriterOptions> children#
- protected boolean isNullable#
- protected boolean hasParquetFieldId#
- protected int parquetFieldId#
Methods
- public T withListColumn(ListColumnWriterOptions child)#
Set the list column meta.
Lists should have only one child in ColumnVector, but the metadata expects a LIST column to have two children and the first child to be the
ColumnWriterOptions.DUMMY_CHILD. This is the current behavior in cudf and will change in future- Returns:
this for chaining.
- public T withMapColumn(ColumnWriterOptions child)#
Set the map column meta.
- Returns:
this for chaining.
- public T withStructColumn(StructColumnWriterOptions child)#
Set a child struct meta data.
- Returns:
this for chaining.
- public T withColumns(boolean nullable, String... names)#
Set a simple child meta data.
- Returns:
this for chaining.
- public T withColumn(boolean nullable, String name, int parquetFieldId)#
Set a simple child meta data.
- Returns:
this for chaining.
- public T withDecimalColumn(
- String name,
- int precision,
- boolean nullable
Set a Decimal child meta data.
- Returns:
this for chaining.
- public T withDecimalColumn(
- String name,
- int precision,
- boolean nullable,
- int parquetFieldId
Set a Decimal child meta data.
- Returns:
this for chaining.
- public T withNullableDecimalColumn(String name, int precision)#
Set a Decimal child meta data.
- Returns:
this for chaining.
- public T withDecimalColumn(String name, int precision)#
Set a Decimal child meta data.
- Returns:
this for chaining.
- public T withBinaryColumn(
- String name,
- boolean nullable,
- int parquetFieldId
Set a binary child meta data.
- Returns:
this for chaining.
- public T withBinaryColumn(String name, boolean nullable)#
Set a binary child meta data.
- Returns:
this for chaining.
- public T withTimestampColumn(
- String name,
- boolean isInt96,
- boolean nullable,
- int parquetFieldId
Set a timestamp child meta data.
- Returns:
this for chaining.
- public T withTimestampColumn(
- String name,
- boolean isInt96,
- boolean nullable
Set a timestamp child meta data.
- Returns:
this for chaining.
- public T withTimestampColumn(String name, boolean isInt96)#
Set a timestamp child meta data.
- Returns:
this for chaining.
- public T withNullableTimestampColumn(String name, boolean isInt96)#
Set a timestamp child meta data.
- Returns:
this for chaining.
- public abstract V build()#
Protected Constructors
- protected NestedBuilder()#
Protected Methods
- protected ColumnWriterOptions withColumn(
- String name,
- boolean isNullable
- protected ColumnWriterOptions withColumn(
- String name,
- boolean isNullable,
- int parquetFieldId
- protected ColumnWriterOptions withDecimal(
- String name,
- int precision,
- boolean isNullable
- protected ColumnWriterOptions withDecimal(
- String name,
- int precision,
- boolean isNullable,
- int parquetFieldId
- protected ColumnWriterOptions withTimestamp(
- String name,
- boolean isInt96,
- boolean isNullable
- protected ColumnWriterOptions withTimestamp(
- String name,
- boolean isInt96,
- boolean isNullable,
- int parquetFieldId
- protected ColumnWriterOptions withBinary(
- String name,
- boolean isNullable
- protected ColumnWriterOptions withBinary(
- String name,
- boolean isNullable,
- int parquetFieldId
- protected interface ByteArrayProducer#
Method Summary
Methods
- public boolean[] apply(ColumnWriterOptions opt)#
- protected interface IntArrayProducer#
Method Summary
Methods
- public int[] apply(ColumnWriterOptions opt)#
- public static class StructColumnWriterOptions extends ColumnWriterOptions#
Subclassed by ai.rapids.cudf.CompressionMetadataWriterOptions
Constructor Summary
Fields inherited from class
ai.rapids.cudf.ColumnWriterOptions:childColumnOptions,UNKNOWN_PRECISIONMethods inherited from class
ai.rapids.cudf.ColumnWriterOptions:getChildColumnOptions,getColumnName,getFlatBooleans,getFlatColumnNames,getFlatInts,getParquetFieldId,getPrecision,hasParquetFieldId,isBinary,isNullable,isTimestampTypeInt96,listBuilder,mapColumn,structBuilderProtected Constructors
- protected StructColumnWriterOptions(AbstractStructBuilder builder)#
- public static class ListColumnWriterOptions extends ColumnWriterOptions#
Constructor Summary
Fields inherited from class
ai.rapids.cudf.ColumnWriterOptions:childColumnOptions,UNKNOWN_PRECISIONMethods inherited from class
ai.rapids.cudf.ColumnWriterOptions:getChildColumnOptions,getColumnName,getFlatBooleans,getFlatColumnNames,getFlatInts,getParquetFieldId,getPrecision,hasParquetFieldId,isBinary,isNullable,isTimestampTypeInt96,listBuilder,mapColumn,structBuilderProtected Constructors
- protected ListColumnWriterOptions(ListBuilder builder)#
- public static class StructBuilder extends AbstractStructBuilder<StructBuilder, StructColumnWriterOptions>#
Constructor Summary
Method Summary
- public static class ListBuilder extends NestedBuilder<ListBuilder, ListColumnWriterOptions>#
Constructor Summary
Method Summary
Fields inherited from class
ai.rapids.cudf.ColumnWriterOptions.NestedBuilder:children,hasParquetFieldId,isNullable,name,parquetFieldIdMethods inherited from class
ai.rapids.cudf.ColumnWriterOptions.NestedBuilder:withBinary,withBinaryColumn,withColumn,withColumns,withDecimal,withDecimalColumn,withListColumn,withMapColumn,withNonNullableColumns,withNullableColumns,withNullableDecimalColumn,withNullableTimestampColumn,withStructColumn,withTimestamp,withTimestampColumn