Class DatasetWriterBase<TRow>
Provides the bounded partition state used by generated dataset writers.
public abstract class DatasetWriterBase<TRow>
Type Parameters
TRowThe generated schema row type.
- Inheritance
-
DatasetWriterBase<TRow>
- Inherited Members
Remarks
This unstable API supports Plank-generated code and is not intended for direct use.
Constructors
DatasetWriterBase(ParquetSchema, RowApiColumnDescriptor[], int, IParquetWriteSource[], DatasetFilePath, DatasetWriterOptions)
Initializes the state used by a generated dataset writer that can create file parts.
protected DatasetWriterBase(ParquetSchema schema, RowApiColumnDescriptor[] columns, int rowBufferCapacity, IParquetWriteSource[] files, DatasetFilePath filePath, DatasetWriterOptions options)
Parameters
schemaParquetSchemaThe one schema shared by all files in the dataset.
columnsRowApiColumnDescriptor[]The generated column descriptors for the schema.
rowBufferCapacityintThe row capacity of each generated buffer slot.
filesIParquetWriteSource[]The fixed reusable file sources.
filePathDatasetFilePathSelects the path of each produced file.
optionsDatasetWriterOptionsThe dataset writer options.
DatasetWriterBase(ParquetSchema, RowApiColumnDescriptor[], int, IParquetWriteSource[], DatasetWriterOptions)
Initializes the state used by a generated dataset writer.
protected DatasetWriterBase(ParquetSchema schema, RowApiColumnDescriptor[] columns, int rowBufferCapacity, IParquetWriteSource[] files, DatasetWriterOptions options)
Parameters
schemaParquetSchemaThe one schema shared by all files in the dataset.
columnsRowApiColumnDescriptor[]The generated column descriptors for the schema.
rowBufferCapacityintThe row capacity of each generated buffer slot.
filesIParquetWriteSource[]The fixed reusable file sources.
optionsDatasetWriterOptionsThe dataset writer options.
Methods
CopyRow(TRow, int, int)
Copies one schema row into the dataset column buffers.
protected abstract void CopyRow(TRow row, int slotIndex, int rowIndex)
Parameters
rowTRowThe source schema row.
slotIndexintThe destination slot identifier.
rowIndexintThe destination row index.
DisposeDataset()
Writes all pending rows and closes all active files.
protected void DisposeDataset()
InitializeSlots()
Creates the fixed set of generated row buffers.
protected void InitializeSlots()
QueueRow(TRow)
Routes and queues one row.
protected void QueueRow(TRow row)
Parameters
rowTRowThe row to queue.
SelectPath(TRow, IParquetBufferPool, out ParquetBuffer?)
Gets the UTF-8 path for one schema row.
protected abstract ReadOnlySpan<byte> SelectPath(TRow row, IParquetBufferPool bufferPool, out ParquetBuffer? allocation)
Parameters
rowTRowThe schema row.
bufferPoolIParquetBufferPoolThe writer buffer pool.
allocationParquetBuffer?The optional allocation that owns the returned path. Set it to null when the path has another owner.
Returns
- ReadOnlySpan<byte>
The full UTF-8 file path.
SetColumnValue<T>(int, int, int, T)
Sets one typed value in a dataset column buffer.
protected void SetColumnValue<T>(int slotIndex, int columnIndex, int rowIndex, T value)
Parameters
slotIndexintThe destination slot identifier.
columnIndexintThe destination column index.
rowIndexintThe destination row index.
valueTThe value to set.
Type Parameters
TThe generated column value type.