Class ParquetDataReader
The ParquetDataReader class enables forward-only reading of data from a Parquet file, implementing the System.Data.IDataReader interface.
If you need to interact with a ParquetDataReader directly, you can process all the data from a Parquet File using a while loop like this:
var reader = new ParquetDataReader(stream); while (reader.Read()) { // Process the data }
Namespace: Workspace.XBR.Xperiflow.Etl.Tabular
Assembly: Xperiflow.dll
public class ParquetDataReader : IDataReader, IDataRecord, IDisposable
Implements:
System.Data.IDataReader, System.Data.IDataRecord, System.IDisposable
Properties
this[int]
Gets the column located at the specified index.
public object this[int i] { get; }
this[string]
Gets the column with the specified name.
public object this[string name] { get; }
Depth
Returns 0 for a ParquetDataReader
public int Depth { get; }
IsClosed
Gets a value indicating whether the data reader is closed.
public bool IsClosed { get; }
RecordsAffected
Returns 0 for a ParquetDataReader
public int RecordsAffected { get; }
FieldCount
Gets the number of columns in the current row.
public int FieldCount { get; }
Methods
Read()
Advances the System.Data.IDataReader to the next record.
public bool Read()
Returns
System.Boolean
true if there are more rows; otherwise, false.
IsDBNull(int)
Return whether the specified field is set to null.
public bool IsDBNull(int i)
Returns
System.Boolean
true if the specified field is set to null; otherwise, false.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetValue(int)
Return the value of the specified field.
public object GetValue(int i)
Returns
System.Object
The System.Object which will contain the field value upon return.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetOrdinal(string)
Return the index of the named field.
public int GetOrdinal(string name)
Returns
System.Int32
The index of the named field.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the field to find. |
GetName(int)
Gets the name for the field to find.
public string GetName(int i)
Returns
System.String
The name of the field or the empty string (""), if there is no value to return.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetFieldType(int)
Gets the System.Type information corresponding to the type of System.Object that would be returned from System.Data.IDataRecord.GetValue(System.Int32).
public Type GetFieldType(int i)
Returns
System.Type
The System.Type information corresponding to the type of System.Object that would be returned from System.Data.IDataRecord.GetValue(System.Int32).
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetBoolean(int)
Gets the value of the specified column as a Boolean.
public bool GetBoolean(int i)
Returns
System.Boolean
The value of the column.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The zero-based column ordinal. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetByte(int)
Gets the 8-bit unsigned integer value of the specified column.
public byte GetByte(int i)
Returns
System.Byte
The 8-bit unsigned integer value of the specified column.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The zero-based column ordinal. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetBytes(int, long, byte[], int, int)
Reads a stream of bytes from the specified column offset into the buffer as an array, starting at the given buffer offset.
public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
Returns
System.Int64
The actual number of bytes read.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The zero-based column ordinal. |
System.Int64 | fieldOffset | The index within the field from which to start the read operation. |
System.Byte[] | buffer | The buffer into which to read the stream of bytes. |
System.Int32 | bufferoffset | The index for buffer to start the read operation. |
System.Int32 | length | The number of bytes to read. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetChar(int)
Gets the character value of the specified column.
public char GetChar(int i)
Returns
System.Char
The character value of the specified column.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The zero-based column ordinal. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetChars(int, long, char[], int, int)
Reads a stream of characters from the specified column offset into the buffer as an array, starting at the given buffer offset.
public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
Returns
System.Int64
The actual number of characters read.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The zero-based column ordinal. |
System.Int64 | fieldoffset | The index within the row from which to start the read operation. |
System.Char[] | buffer | The buffer into which to read the stream of bytes. |
System.Int32 | bufferoffset | The index for buffer to start the read operation. |
System.Int32 | length | The number of bytes to read. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetData(int)
Not implemented for Parquet
public IDataReader GetData(int i)
Returns
System.Data.IDataReader
Not Supported Exception
Parameters
| Type | Name |
|---|---|
System.Int32 | i |
Exceptions
System.NotSupportedException
GetDataTypeName(int)
Gets the data type information for the specified field.
public string GetDataTypeName(int i)
Returns
System.String
The data type information for the specified field.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetDateTime(int)
Gets the date and time data value of the specified field.
public DateTime GetDateTime(int i)
Returns
System.DateTime
The date and time data value of the specified field.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetDecimal(int)
Gets the fixed-position numeric value of the specified field.
public decimal GetDecimal(int i)
Returns
System.Decimal
The fixed-position numeric value of the specified field.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetDouble(int)
Gets the double-precision floating point number of the specified field.
public double GetDouble(int i)
Returns
System.Double
The double-precision floating point number of the specified field.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetFloat(int)
Gets the single-precision floating point number of the specified field.
public float GetFloat(int i)
Returns
System.Single
The single-precision floating point number of the specified field.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetGuid(int)
Returns the GUID value of the specified field.
public Guid GetGuid(int i)
Returns
System.Guid
The GUID value of the specified field.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetInt16(int)
Gets the 16-bit signed integer value of the specified field.
public short GetInt16(int i)
Returns
System.Int16
The 16-bit signed integer value of the specified field.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetInt32(int)
Gets the 32-bit signed integer value of the specified field.
public int GetInt32(int i)
Returns
System.Int32
The 32-bit signed integer value of the specified field.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetInt64(int)
Gets the 64-bit signed integer value of the specified field.
public long GetInt64(int i)
Returns
System.Int64
The 64-bit signed integer value of the specified field.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetValues(object[])
Populates an array of objects with the column values of the current record.
public int GetValues(object[] values)
Returns
System.Int32
The number of instances of System.Object in the array.
Parameters
| Type | Name | Description |
|---|---|---|
System.Object[] | values | An array of System.Object to copy the attribute fields into. |
GetString(int)
Gets the string value of the specified field.
public string GetString(int i)
Returns
System.String
The string value of the specified field.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | i | The index of the field to find. |
Exceptions
System.IndexOutOfRangeException
The index passed was outside the range of 0 through System.Data.IDataRecord.FieldCount.
GetSchemaTable()
Returns a System.Data.DataTable that describes the column metadata of the System.Data.IDataReader.
Returns null if the executed command returned no resultset, or after System.Data.IDataReader.NextResult returns false.
public DataTable GetSchemaTable()
Returns
System.Data.DataTable
A System.Data.DataTable that describes the column metadata.
Exceptions
System.InvalidOperationException
The System.Data.IDataReader is closed.
NextResult()
Returns false for a ParquetDataReader
public bool NextResult()
Returns
System.Boolean
false
Close()
Closes the System.Data.IDataReader Object.
public void Close()
Dispose(bool)
Disposes the ParquetDataReader object.
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name |
|---|---|
System.Boolean | disposing |
Dispose()
Disposes the ParquetDataReader object.
public void Dispose()
Implements
System.Data.IDataReaderSystem.Data.IDataRecordSystem.IDisposable
Inherited Members
System.Object.Equals(System.Object)System.Object.Equals(System.Object,System.Object)System.Object.GetHashCodeSystem.Object.GetTypeSystem.Object.MemberwiseCloneSystem.Object.ReferenceEquals(System.Object,System.Object)System.Object.ToString