Class FileReader
- Namespace
- ParquetSharp.Arrow
- Assembly
- ParquetSharp.dll
Reads Parquet files using the Arrow format.
public class FileReader : IDisposable
- Inheritance
-
FileReader
- Implements
- Inherited Members
Constructors
FileReader(RandomAccessFile, ReaderProperties?, ArrowReaderProperties?)
Create a new Arrow FileReader for a file object
public FileReader(RandomAccessFile file, ReaderProperties? properties = null, ArrowReaderProperties? arrowProperties = null)
Parameters
file
RandomAccessFileThe file to read
properties
ReaderPropertiesParquet reader properties
arrowProperties
ArrowReaderPropertiesArrow specific reader properties
Exceptions
- ArgumentNullException
Thrown if the file or its handle are null
FileReader(Stream, ReaderProperties?, ArrowReaderProperties?, bool)
Create a new Arrow FileReader for a .NET stream
public FileReader(Stream stream, ReaderProperties? properties = null, ArrowReaderProperties? arrowProperties = null, bool leaveOpen = false)
Parameters
stream
StreamThe stream to read
properties
ReaderPropertiesParquet reader properties
arrowProperties
ArrowReaderPropertiesArrow specific reader properties
leaveOpen
boolWhether to keep the stream open after the reader is closed
Exceptions
- ArgumentNullException
Thrown if the file or its handle are null
FileReader(string, ReaderProperties?, ArrowReaderProperties?)
Create a new Arrow FileReader for a file at the specified path
public FileReader(string path, ReaderProperties? properties = null, ArrowReaderProperties? arrowProperties = null)
Parameters
path
stringPath to the Parquet file
properties
ReaderPropertiesParquet reader properties
arrowProperties
ArrowReaderPropertiesArrow specific reader properties
Properties
NumRowGroups
The number of row groups in the file
public int NumRowGroups { get; }
Property Value
ParquetReader
Get the underlying ParquetFileReader used by this Arrow FileReader
public ParquetFileReader ParquetReader { get; }
Property Value
Schema
The Arrow schema of the file being read
public Schema Schema { get; }
Property Value
- Schema
SchemaManifest
Get the schema manifest, which describes the relationship between the Arrow schema and Parquet schema
public SchemaManifest SchemaManifest { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetRecordBatchReader(int[]?, int[]?)
Get a record batch reader for the file data
public IArrowArrayStream GetRecordBatchReader(int[]? rowGroups = null, int[]? columns = null)
Parameters
rowGroups
int[]The indices of row groups to read data from
columns
int[]The indices of columns to read, based on the schema
Returns
- IArrowArrayStream
An Arrow array stream reader