Skip to content

Commit a32ccdb

Browse files
committed
move definition to a better place
1 parent f6fd915 commit a32ccdb

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

parquet-variant-compute/src/variant_get/output/row_builder.rs

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
}
236219
impl 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
273274
struct PrimitiveVariantShreddingRowBuilder<'a, T: ArrowPrimitiveType> {
274275
builder: arrow::array::PrimitiveBuilder<T>,

0 commit comments

Comments
 (0)