Table of Contents

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 RandomAccessFile

The file to read

properties ReaderProperties

Parquet reader properties

arrowProperties ArrowReaderProperties

Arrow 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 Stream

The stream to read

properties ReaderProperties

Parquet reader properties

arrowProperties ArrowReaderProperties

Arrow specific reader properties

leaveOpen bool

Whether 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 string

Path to the Parquet file

properties ReaderProperties

Parquet reader properties

arrowProperties ArrowReaderProperties

Arrow specific reader properties

Properties

NumRowGroups

The number of row groups in the file

public int NumRowGroups { get; }

Property Value

int

ParquetReader

Get the underlying ParquetFileReader used by this Arrow FileReader

public ParquetFileReader ParquetReader { get; }

Property Value

ParquetFileReader

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

SchemaManifest

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