@@ -216,23 +216,6 @@ trait VariantAsPrimitive<T: ArrowPrimitiveType> {
216216 fn as_primitive ( & self ) -> Option < T :: Native > ;
217217}
218218
219- /// Helper function to get a user-friendly type name
220- fn get_type_name < T : ArrowPrimitiveType > ( ) -> & ' static str {
221- match std:: any:: type_name :: < T > ( ) {
222- "arrow_array::types::Int32Type" => "Int32" ,
223- "arrow_array::types::Int16Type" => "Int16" ,
224- "arrow_array::types::Int8Type" => "Int8" ,
225- "arrow_array::types::Int64Type" => "Int64" ,
226- "arrow_array::types::UInt32Type" => "UInt32" ,
227- "arrow_array::types::UInt16Type" => "UInt16" ,
228- "arrow_array::types::UInt8Type" => "UInt8" ,
229- "arrow_array::types::UInt64Type" => "UInt64" ,
230- "arrow_array::types::Float32Type" => "Float32" ,
231- "arrow_array::types::Float64Type" => "Float64" ,
232- "arrow_array::types::Float16Type" => "Float16" ,
233- _ => "Unknown" ,
234- }
235- }
236219impl VariantAsPrimitive < datatypes:: Int32Type > for Variant < ' _ , ' _ > {
237220 fn as_primitive ( & self ) -> Option < i32 > {
238221 self . as_int32 ( )
@@ -269,6 +252,24 @@ impl VariantAsPrimitive<datatypes::Float64Type> for Variant<'_, '_> {
269252 }
270253}
271254
255+ /// Helper function to get a user-friendly type name
256+ fn get_type_name < T : ArrowPrimitiveType > ( ) -> & ' static str {
257+ match std:: any:: type_name :: < T > ( ) {
258+ "arrow_array::types::Int32Type" => "Int32" ,
259+ "arrow_array::types::Int16Type" => "Int16" ,
260+ "arrow_array::types::Int8Type" => "Int8" ,
261+ "arrow_array::types::Int64Type" => "Int64" ,
262+ "arrow_array::types::UInt32Type" => "UInt32" ,
263+ "arrow_array::types::UInt16Type" => "UInt16" ,
264+ "arrow_array::types::UInt8Type" => "UInt8" ,
265+ "arrow_array::types::UInt64Type" => "UInt64" ,
266+ "arrow_array::types::Float32Type" => "Float32" ,
267+ "arrow_array::types::Float64Type" => "Float64" ,
268+ "arrow_array::types::Float16Type" => "Float16" ,
269+ _ => "Unknown" ,
270+ }
271+ }
272+
272273/// Builder for shredding variant values to primitive values
273274struct PrimitiveVariantShreddingRowBuilder < ' a , T : ArrowPrimitiveType > {
274275 builder : arrow:: array:: PrimitiveBuilder < T > ,
0 commit comments