Class ParquetStorage<T>
This class provides access to Parquet files and parses the data into the application-side type T.
Inheritance
Namespace: TeleScope.Persistence.Parquet
Assembly: TeleScope.Persistence.Parquet.dll
Syntax
public class ParquetStorage<T> : object, IReadable<T>, IFileWritable<T>, IWritable<T> where T : new()
Type Parameters
Name | Description |
---|---|
T | The type T is used application-side and can be read from the data source or be written to the data sink. |
Constructors
| Improve this Doc View SourceParquetStorage(String)
The constructor takes the file string as input parameter, creates the ParquetStorageSetup and allows to config the properties afterwards.
Declaration
public ParquetStorage(string file)
Parameters
Type | Name | Description |
---|---|---|
System.String | file | The specific Parquet file that the storage is related to. |
ParquetStorage(ParquetStorageSetup)
The constructor takes the setup of type ParquetStorageSetup as input parameter and binds the logging mechanism.
Declaration
public ParquetStorage(ParquetStorageSetup parquetSetup)
Parameters
Type | Name | Description |
---|---|---|
ParquetStorageSetup | parquetSetup | The setup is needed to work with a specific Parquet file. |
Properties
| Improve this Doc View SourcePermissions
Gets the flags of permissions how files may be treated.
Declaration
public WritePermissions Permissions { get; }
Property Value
Type | Description |
---|---|
WritePermissions |
Methods
| Improve this Doc View SourceHasPermission(WritePermissions)
Checks if the permission is a present flag or not.
Declaration
public bool HasPermission(WritePermissions permission)
Parameters
Type | Name | Description |
---|---|---|
WritePermissions | permission | The enum that is checked. |
Returns
Type | Description |
---|---|
System.Boolean | True if the value is a present flag, otherwise false. |
Read()
Reads a given Parquet file as data source and provides a collection of type T. If there is only one data object a collection with the length one is returned.
Declaration
public IEnumerable<T> Read()
Returns
Type | Description |
---|---|
IEnumerable<T> | The resulting data objects of type T. |
Update(FileInfo)
Updates the reference to the internal
Declaration
public IFileWritable<T> Update(FileInfo fileInfo)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | fileInfo | The new FileInfo object. |
Returns
Type | Description |
---|---|
IFileWritable<T> | The calling instance. |
Update(String)
Updates the reference to the internal
Declaration
public IFileWritable<T> Update(string file)
Parameters
Type | Name | Description |
---|---|---|
System.String | file | The new string of the file. |
Returns
Type | Description |
---|---|
IFileWritable<T> | The calling instance. |
Write(IEnumerable<T>)
Writes a collection of type T to a Parquet file as data sink. If there is only one data object there is the need to provide a collection with one element. If the collection has only one element the Parquet file won't have an array as root element.
Declaration
public void Write(IEnumerable<T> data)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | data | The application-side data collection of type T. |