@@ -105,6 +105,34 @@ public Apache.Arrow.Types.TimeUnit CoerceInt96TimestampUnit
105105 }
106106 }
107107
108+ /// <summary>
109+ /// The Arrow binary type to read BYTE_ARRAY columns as.
110+ ///
111+ /// Allowed values are ArrowTypeId.Binary, ArrowTypeId.LargeBinary and ArrowTypeId.BinaryView.
112+ /// Default is ArrowTypeId.Binary.
113+ ///
114+ /// If a BYTE_ARRAY column has the STRING logical type, it is read as the
115+ /// Arrow string type corresponding to the configured binary type (for example
116+ /// Type::LARGE_STRING if the configured binary type is Type::LARGE_BINARY).
117+ ///
118+ /// However, if a serialized Arrow schema is found in the Parquet metadata,
119+ /// this setting is ignored and the Arrow schema takes precedence
120+ /// </summary>
121+ public Apache . Arrow . Types . ArrowTypeId BinaryType
122+ {
123+ get
124+ {
125+ ParquetSharp . CppTypeId value = ExceptionInfo . Return < ParquetSharp . CppTypeId > ( Handle , ArrowReaderProperties_BinaryType ) ;
126+ return value . toPublicEnum ( ) ;
127+ }
128+ set
129+ {
130+ ParquetSharp . CppTypeId cppValue = value . toCppEnum ( ) ;
131+ ExceptionInfo . Check ( ArrowReaderProperties_SetBinaryType ( Handle . IntPtr , cppValue ) ) ;
132+ GC . KeepAlive ( Handle ) ;
133+ }
134+ }
135+
108136 [ DllImport ( ParquetDll . Name ) ]
109137 private static extern IntPtr ArrowReaderProperties_GetDefault ( out IntPtr readerProperties ) ;
110138
@@ -141,6 +169,12 @@ public Apache.Arrow.Types.TimeUnit CoerceInt96TimestampUnit
141169 [ DllImport ( ParquetDll . Name ) ]
142170 private static extern IntPtr ArrowReaderProperties_SetCoerceInt96TimestampUnit ( IntPtr readerProperties , Apache . Arrow . Types . TimeUnit unit ) ;
143171
172+ [ DllImport ( ParquetDll . Name ) ]
173+ private static extern IntPtr ArrowReaderProperties_BinaryType ( IntPtr readerProperties , out ParquetSharp . CppTypeId value ) ;
174+
175+ [ DllImport ( ParquetDll . Name ) ]
176+ private static extern IntPtr ArrowReaderProperties_SetBinaryType ( IntPtr readerProperties , ParquetSharp . CppTypeId value ) ;
177+
144178 internal readonly ParquetHandle Handle ;
145179 }
146180}
0 commit comments