public static TValue Return <TArg0, TValue>(ParquetHandle handle, TArg0 arg0, GetFunction <TArg0, TValue> getter) { var value = Return(handle.IntPtr, arg0, getter); GC.KeepAlive(handle); return(value); }
internal ColumnReader(ParquetHandle handle, RowGroupReader rowGroupReader, ColumnChunkMetaData columnChunkMetaData, int columnIndex) { Handle = handle; RowGroupReader = rowGroupReader; ColumnChunkMetaData = columnChunkMetaData; ColumnIndex = columnIndex; }
public FileEncryptionPropertiesBuilder(byte[] footerKey) { var footerAesKey = new AesKey(footerKey); ExceptionInfo.Check(FileEncryptionPropertiesBuilder_Create(in footerAesKey, out var handle)); _handle = new ParquetHandle(handle, FileEncryptionPropertiesBuilder_Free); }
internal static Statistics?Create(IntPtr handle) { if (handle == IntPtr.Zero) { return(null); } var parquetHandle = new ParquetHandle(handle, Statistics_Free); try { var type = ExceptionInfo.Return <PhysicalType>(handle, Statistics_Physical_Type); return(type switch { PhysicalType.Boolean => new Statistics <bool>(parquetHandle), PhysicalType.Int32 => new Statistics <int>(parquetHandle), PhysicalType.Int64 => new Statistics <long>(parquetHandle), PhysicalType.Int96 => new Statistics <Int96>(parquetHandle), PhysicalType.Float => new Statistics <float>(parquetHandle), PhysicalType.Double => new Statistics <double>(parquetHandle), PhysicalType.ByteArray => new Statistics <ByteArray>(parquetHandle), PhysicalType.FixedLenByteArray => new Statistics <FixedLenByteArray>(parquetHandle), _ => throw new NotSupportedException($"Physical type {type} is not supported") }); }
private static string ConvertPtrToString(ParquetHandle handle, Action <IntPtr>?deleter, IntPtr value) { var str = Marshal.PtrToStringAnsi(value); deleter?.Invoke(value); GC.KeepAlive(handle); return(str); }
public static string ReturnString(ParquetHandle handle, GetFunction <IntPtr> getter, Action <IntPtr> deleter = null) { Check(getter(handle.IntPtr, out var value)); var str = Marshal.PtrToStringAnsi(value); deleter?.Invoke(value); GC.KeepAlive(handle); return(str); }
public ParquetFileReader(InputStream inputStream) { if (inputStream == null) { throw new ArgumentNullException(nameof(inputStream)); } _handle = new ParquetHandle(ExceptionInfo.Return <IntPtr>(inputStream.Handle, ParquetFileReader_Open), ParquetFileReader_Free); }
public ParquetFileReader(RandomAccessFile randomAccessFile) { if (randomAccessFile == null) { throw new ArgumentNullException(nameof(randomAccessFile)); } _handle = new ParquetHandle(ExceptionInfo.Return <IntPtr>(randomAccessFile.Handle, ParquetFileReader_Open), ParquetFileReader_Free); }
public ParquetFileReader(string path) { if (path == null) { throw new ArgumentNullException(nameof(path)); } ExceptionInfo.Check(ParquetFileReader_OpenFile(path, out var reader)); _handle = new ParquetHandle(reader, ParquetFileReader_Free); }
internal static Statistics Create(IntPtr handle) { if (handle == IntPtr.Zero) { return(null); } var parquetHandle = new ParquetHandle(handle, Statistics_Free); try { var type = ExceptionInfo.Return <PhysicalType>(handle, Statistics_Physical_Type); switch (type) { case PhysicalType.Boolean: return(new Statistics <bool>(parquetHandle)); case PhysicalType.Int32: return(new Statistics <int>(parquetHandle)); case PhysicalType.Int64: return(new Statistics <long>(parquetHandle)); case PhysicalType.Int96: return(new Statistics <Int96>(parquetHandle)); case PhysicalType.Float: return(new Statistics <float>(parquetHandle)); case PhysicalType.Double: return(new Statistics <double>(parquetHandle)); case PhysicalType.ByteArray: return(new Statistics <ByteArray>(parquetHandle)); case PhysicalType.FixedLenByteArray: return(new Statistics <FixedLenByteArray>(parquetHandle)); default: throw new NotSupportedException($"Physical type {type} is not supported"); } } catch { parquetHandle.Dispose(); throw; } }
public ParquetFileReader(RandomAccessFile randomAccessFile, ReaderProperties readerProperties) { if (randomAccessFile == null) { throw new ArgumentNullException(nameof(randomAccessFile)); } if (readerProperties == null) { throw new ArgumentNullException(nameof(readerProperties)); } _handle = new ParquetHandle(ExceptionInfo.Return <IntPtr, IntPtr>(randomAccessFile.Handle, readerProperties.Handle.IntPtr, ParquetFileReader_Open), ParquetFileReader_Free); GC.KeepAlive(readerProperties); }
public ParquetFileReader(string path, ReaderProperties readerProperties) { if (path == null) { throw new ArgumentNullException(nameof(path)); } if (readerProperties == null) { throw new ArgumentNullException(nameof(readerProperties)); } ExceptionInfo.Check(ParquetFileReader_OpenFile(path, readerProperties.Handle.IntPtr, out var reader)); _handle = new ParquetHandle(reader, ParquetFileReader_Free); GC.KeepAlive(readerProperties); }
internal static ColumnReader Create(IntPtr handle, ColumnChunkMetaData columnChunkMetaData) { var parquetHandle = new ParquetHandle(handle, ColumnReader_Free); try { var type = ExceptionInfo.Return <PhysicalType>(handle, ColumnReader_Type); switch (type) { case PhysicalType.Boolean: return(new ColumnReader <bool>(parquetHandle, columnChunkMetaData)); case PhysicalType.Int32: return(new ColumnReader <int>(parquetHandle, columnChunkMetaData)); case PhysicalType.Int64: return(new ColumnReader <long>(parquetHandle, columnChunkMetaData)); case PhysicalType.Int96: return(new ColumnReader <Int96>(parquetHandle, columnChunkMetaData)); case PhysicalType.Float: return(new ColumnReader <float>(parquetHandle, columnChunkMetaData)); case PhysicalType.Double: return(new ColumnReader <double>(parquetHandle, columnChunkMetaData)); case PhysicalType.ByteArray: return(new ColumnReader <ByteArray>(parquetHandle, columnChunkMetaData)); case PhysicalType.FixedLenByteArray: return(new ColumnReader <FixedLenByteArray>(parquetHandle, columnChunkMetaData)); default: throw new NotSupportedException($"Physical type {type} is not supported"); } } catch { parquetHandle.Dispose(); throw; } }
public WriterPropertiesBuilder() { ExceptionInfo.Check(WriterPropertiesBuilder_Create(out var handle)); _handle = new ParquetHandle(handle, WriterPropertiesBuilder_Free); }
internal ColumnReader(ParquetHandle handle, ColumnChunkMetaData columnChunkMetaData) { Handle = handle; ColumnChunkMetaData = columnChunkMetaData; }
public FileDecryptionPropertiesBuilder() { ExceptionInfo.Check(FileDecryptionPropertiesBuilder_Create(out var handle)); _handle = new ParquetHandle(handle, FileDecryptionPropertiesBuilder_Free); }
internal ColumnChunkMetaData(IntPtr handle) { _handle = new ParquetHandle(handle, ColumnChunkMetaData_Free); }
internal FileDecryptionProperties(IntPtr handle) { Handle = new ParquetHandle(handle, FileDecryptionProperties_Free); }
internal FileMetaData(IntPtr handle) { _handle = new ParquetHandle(handle, FileMetaData_Free); }
internal ReaderProperties(IntPtr handle) { Handle = new ParquetHandle(handle, ReaderProperties_Free); }
public KeyValueMetadata(IntPtr handle) { Handle = new ParquetHandle(handle, KeyValueMetadata_Free); }
protected LogicalType(IntPtr handle) { Handle = new ParquetHandle(handle, LogicalType_Free); }
public ParquetFileReader(InputStream inputStream) { ExceptionInfo.Check(ParquetFileReader_Open(inputStream.Handle, out var reader)); GC.KeepAlive(inputStream); _handle = new ParquetHandle(reader, ParquetFileReader_Free); }
internal WriterProperties(IntPtr handle) { Handle = new ParquetHandle(handle, WriterProperties_Free); }
internal RowGroupReader(IntPtr handle) { _handle = new ParquetHandle(handle, RowGroupReader_Free); }
internal RowGroupReader(IntPtr handle, ParquetFileReader parquetFileReader) { _handle = new ParquetHandle(handle, RowGroupReader_Free); ParquetFileReader = parquetFileReader; }
public ParquetFileReader(string path) { ExceptionInfo.Check(ParquetFileReader_OpenFile(path, out var reader)); _handle = new ParquetHandle(reader, ParquetFileReader_Free); }
public static string ReturnString(ParquetHandle handle, GetFunction <IntPtr> getter, Action <IntPtr>?deleter = null) { Check(getter(handle.IntPtr, out var value)); return(ConvertPtrToString(handle, deleter, value)); }
internal ColumnDecryptionPropertiesBuilder(IntPtr handle) { _handle = new ParquetHandle(handle, ColumnDecryptionPropertiesBuilder_Free); }
internal ColumnEncryptionProperties(IntPtr handle) { Handle = new ParquetHandle(handle, ColumnEncryptionProperties_Free); }