Skip to main content

Class ParquetUtil

Provides utility methods for reading and writing Parquet data to and from DataFrame and DataTable objects.

Namespace: Workspace.XBR.Xperiflow.Etl.Tabular.Utilities

Assembly: Xperiflow.dll

Declaration
public static class ParquetUtil

Methods​

WriteDataFrameToParquetAsync(DataFrame, Stream, CancellationToken)​

Writes the provided DataFrame to the provided Stream in Parquet format.

Declaration
public static Task WriteDataFrameToParquetAsync(DataFrame df, Stream outputStream, CancellationToken cancellationToken = default)
Returns​

System.Threading.Tasks.Task

A Task representing the asynchronous operation

Parameters​
TypeNameDescription
Microsoft.Data.Analysis.DataFramedfThe DataFrame to write to the output stream
System.IO.StreamoutputStreamThe Stream to write the Parquet data to
System.Threading.CancellationTokencancellationTokenThe System.Threading.CancellationToken to cancel the operation
Exceptions​

System.InvalidOperationException

ReadParquetToDataFrameAsync(Stream, CancellationToken)​

Reads the provided Stream containing data in a Parquet format to a DataFrame asynchronously.

Declaration
public static Task<DataFrame> ReadParquetToDataFrameAsync(Stream inputStream, CancellationToken cancellationToken = default)
Returns​

Task<Microsoft.Data.Analysis.DataFrame>

A Task representing the asynchronous operation. Access the resulting DataFrame with the Task.Result property

Parameters​
TypeNameDescription
System.IO.StreaminputStreamThe Stream to read the Parquet data from
System.Threading.CancellationTokencancellationTokenThe System.Threading.CancellationToken to cancel the operation

WriteDataTableToParquetAsync(DataTable, Stream, bool, CancellationToken)​

Writes the data from the provided DataTable to the Stream in a Parquet format.

Declaration
public static Task WriteDataTableToParquetAsync(DataTable dt, Stream fs, bool useCustomMetadata = true, CancellationToken cancellationToken = default)
Returns​

System.Threading.Tasks.Task

A Task representing the asynchronous operation

Parameters​
TypeNameDescription
System.Data.DataTabledtThe DataTable to write to the Stream
System.IO.StreamfsThe Stream to write the Parquet data to
System.BooleanuseCustomMetadataA bool value to determine if custom metadata should be used
System.Threading.CancellationTokencancellationTokenA System.Threading.CancellationToken to cancel the asynchronous operation
Exceptions​

System.ArgumentNullException

System.ArgumentException

ReadParquetToDataTableAsync(Stream, bool)​

Reads the data from the provided Stream in a Parquet format to a DataTable asynchronously.

Declaration
public static Task<DataTable> ReadParquetToDataTableAsync(Stream fs, bool useCustomMetadata = true)
Returns​

Task<System.Data.DataTable>

A Task representing the asynchronous operation. Access the DataTable from the Task.Result property

Parameters​
TypeNameDescription
System.IO.StreamfsThe Stream to read the Parquet data from
System.BooleanuseCustomMetadataA bool value to determine if custom metadata should be used

Inherited Members​

  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object,System.Object)
  • System.Object.GetHashCode
  • System.Object.GetType
  • System.Object.MemberwiseClone
  • System.Object.ReferenceEquals(System.Object,System.Object)
  • System.Object.ToString

Was this page helpful?