23
23
//! Extension types are represented using the metadata from Arrow [`Field`]s
24
24
//! with the key "ARROW:extension:name".
25
25
26
- use arrow_schema:: { Field } ;
27
- use arrow_schema:: extension:: ExtensionType ;
28
26
use crate :: basic:: LogicalType ;
29
27
use crate :: schema:: types:: Type ;
28
+ use arrow_schema:: extension:: ExtensionType ;
29
+ use arrow_schema:: Field ;
30
30
31
31
/// Adds extension type metadata, if necessary, based on the Parquet field's
32
32
/// [`LogicalType`]
@@ -38,11 +38,10 @@ pub(crate) fn add_extension_type(arrow_field: Field, parquet_type: &Type) -> Fie
38
38
let result = match parquet_type. get_basic_info ( ) . logical_type ( ) {
39
39
#[ cfg( feature = "variant_experimental" ) ]
40
40
Some ( LogicalType :: Variant ) => {
41
- arrow_field
42
- . with_extension_type ( parquet_variant_compute:: VariantType )
41
+ arrow_field. with_extension_type ( parquet_variant_compute:: VariantType )
43
42
}
44
43
// TODO add other LogicalTypes here
45
- _ => arrow_field
44
+ _ => arrow_field,
46
45
} ;
47
46
result
48
47
}
@@ -52,12 +51,12 @@ pub(crate) fn add_extension_type(arrow_field: Field, parquet_type: &Type) -> Fie
52
51
pub ( crate ) fn logical_type_for_struct ( field : & Field ) -> Option < LogicalType > {
53
52
use parquet_variant_compute:: VariantType ;
54
53
if field. extension_type_name ( ) ? == VariantType :: NAME {
55
- return Some ( LogicalType :: Variant )
54
+ return Some ( LogicalType :: Variant ) ;
56
55
} ;
57
56
None
58
57
}
59
58
60
59
#[ cfg( not( feature = "variant_experimental" ) ) ]
61
60
pub ( crate ) fn logical_type_for_struct ( field : & Field ) -> Option < LogicalType > {
62
61
None
63
- }
62
+ }
0 commit comments