1515// specific language governing permissions and limitations
1616// under the License.
1717use crate :: schema:: {
18- make_full_name , Array , Attributes , ComplexType , Enum , Fixed , Map , Nullability , PrimitiveType ,
19- Record , Schema , Type , TypeName , AVRO_ENUM_SYMBOLS_METADATA_KEY ,
20- AVRO_FIELD_DEFAULT_METADATA_KEY , AVRO_NAMESPACE_METADATA_KEY , AVRO_NAME_METADATA_KEY ,
18+ AVRO_ENUM_SYMBOLS_METADATA_KEY , AVRO_FIELD_DEFAULT_METADATA_KEY , AVRO_NAME_METADATA_KEY ,
19+ AVRO_NAMESPACE_METADATA_KEY , Array , Attributes , ComplexType , Enum , Fixed , Map , Nullability ,
20+ PrimitiveType , Record , Schema , Type , TypeName , make_full_name ,
2121} ;
2222use arrow_schema:: {
23- ArrowError , DataType , Field , Fields , IntervalUnit , TimeUnit , UnionFields , UnionMode ,
24- DECIMAL128_MAX_PRECISION , DECIMAL256_MAX_PRECISION ,
23+ ArrowError , DECIMAL128_MAX_PRECISION , DECIMAL256_MAX_PRECISION , DataType , Field , Fields ,
24+ IntervalUnit , TimeUnit , UnionFields , UnionMode ,
2525} ;
2626#[ cfg( feature = "small_decimals" ) ]
2727use arrow_schema:: { DECIMAL32_MAX_PRECISION , DECIMAL64_MAX_PRECISION } ;
@@ -324,14 +324,14 @@ impl AvroDataType {
324324 Codec :: Null => {
325325 return Err ( ArrowError :: SchemaError (
326326 "Default for `null` type must be JSON null" . to_string ( ) ,
327- ) )
327+ ) ) ;
328328 }
329329 Codec :: Boolean => match default_json {
330330 Value :: Bool ( b) => AvroLiteral :: Boolean ( * b) ,
331331 _ => {
332332 return Err ( ArrowError :: SchemaError (
333333 "Boolean default must be a JSON boolean" . to_string ( ) ,
334- ) )
334+ ) ) ;
335335 }
336336 } ,
337337 Codec :: Int32 | Codec :: Date32 | Codec :: TimeMillis => {
@@ -393,7 +393,7 @@ impl AvroDataType {
393393 _ => {
394394 return Err ( ArrowError :: SchemaError (
395395 "Default value must be a JSON array for Avro array type" . to_string ( ) ,
396- ) )
396+ ) ) ;
397397 }
398398 } ,
399399 Codec :: Map ( val_dt) => match default_json {
@@ -407,7 +407,7 @@ impl AvroDataType {
407407 _ => {
408408 return Err ( ArrowError :: SchemaError (
409409 "Default value must be a JSON object for Avro map type" . to_string ( ) ,
410- ) )
410+ ) ) ;
411411 }
412412 } ,
413413 Codec :: Struct ( fields) => match default_json {
@@ -449,7 +449,7 @@ impl AvroDataType {
449449 _ => {
450450 return Err ( ArrowError :: SchemaError (
451451 "Default value for record/struct must be a JSON object" . to_string ( ) ,
452- ) )
452+ ) ) ;
453453 }
454454 } ,
455455 Codec :: Union ( encodings, _, _) => {
@@ -1622,7 +1622,7 @@ impl<'a> Maker<'a> {
16221622 _ => {
16231623 return Err ( ArrowError :: ParseError ( format ! (
16241624 "Illegal promotion {write_primitive:?} to {read_primitive:?}"
1625- ) ) )
1625+ ) ) ) ;
16261626 }
16271627 } ;
16281628 let mut datatype = self . parse_type ( reader_schema, None ) ?;
@@ -1894,8 +1894,8 @@ impl<'a> Maker<'a> {
18941894mod tests {
18951895 use super :: * ;
18961896 use crate :: schema:: {
1897- Array , Attributes , ComplexType , Field as AvroFieldSchema , Fixed , PrimitiveType , Record ,
1898- Schema , Type , TypeName , AVRO_ROOT_RECORD_DEFAULT_NAME ,
1897+ AVRO_ROOT_RECORD_DEFAULT_NAME , Array , Attributes , ComplexType , Field as AvroFieldSchema ,
1898+ Fixed , PrimitiveType , Record , Schema , Type , TypeName ,
18991899 } ;
19001900 use indexmap:: IndexMap ;
19011901 use serde_json:: { self , Value } ;
0 commit comments