@@ -912,7 +912,8 @@ Result<::avro::NodePtr> CreateMapNodeWithFieldIds(const ::avro::NodePtr& origina
912912
913913 auto new_map_node = std::make_shared<::avro::NodeMap>();
914914
915- // For map types, we need to extract key and value field mappings from the nested mapping
915+ // For map types, we need to extract key and value field mappings from the nested
916+ // mapping
916917 if (!field.nested_mapping ) {
917918 return InvalidSchema (" Map type requires nested mapping for key and value fields" );
918919 }
@@ -926,7 +927,8 @@ Result<::avro::NodePtr> CreateMapNodeWithFieldIds(const ::avro::NodePtr& origina
926927 }
927928
928929 std::optional<MappedFieldConstRef> key_field_ref = field.nested_mapping ->Field (*key_id);
929- std::optional<MappedFieldConstRef> value_field_ref = field.nested_mapping ->Field (*value_id);
930+ std::optional<MappedFieldConstRef> value_field_ref =
931+ field.nested_mapping ->Field (*value_id);
930932
931933 if (!key_field_ref || !value_field_ref) {
932934 return InvalidSchema (" Map type requires both key and value field mappings" );
@@ -950,16 +952,16 @@ Result<::avro::NodePtr> CreateMapNodeWithFieldIds(const ::avro::NodePtr& origina
950952 value_field.nested_mapping = value_mapped_field.nested_mapping ;
951953
952954 // Add key and value nodes
953- ICEBERG_ASSIGN_OR_RAISE (
954- auto new_key_node, MakeAvroNodeWithFieldIds (original_node->leafAt (0 ), key_field));
955+ ICEBERG_ASSIGN_OR_RAISE (auto new_key_node,
956+ MakeAvroNodeWithFieldIds (original_node->leafAt (0 ), key_field));
955957 ICEBERG_ASSIGN_OR_RAISE (
956958 auto new_value_node,
957959 MakeAvroNodeWithFieldIds (original_node->leafAt (1 ), value_field));
958960 new_map_node->addLeaf (new_key_node);
959961 new_map_node->addLeaf (new_value_node);
960962
961- // Preserve existing custom attributes from the original node and add field ID attributes
962- // Copy existing attributes from the original node (if any)
963+ // Preserve existing custom attributes from the original node and add field ID
964+ // attributes Copy existing attributes from the original node (if any)
963965 if (original_node->customAttributes () > 0 ) {
964966 const auto & original_attrs = original_node->customAttributesAt (0 );
965967 const auto & existing_attrs = original_attrs.attributes ();
@@ -971,7 +973,6 @@ Result<::avro::NodePtr> CreateMapNodeWithFieldIds(const ::avro::NodePtr& origina
971973 }
972974 }
973975
974- // Add field ID attributes for key and value as separate custom attributes
975976 ::avro::CustomAttributes key_attributes;
976977 key_attributes.addAttribute (std::string (kFieldIdProp ),
977978 std::to_string (*key_mapped_field.field_id ), false );
@@ -999,16 +1000,14 @@ Result<::avro::NodePtr> CreateUnionNodeWithFieldIds(const ::avro::NodePtr& origi
9991000
10001001 if (branch_0_is_null && !branch_1_is_null) {
10011002 // branch_0 is null, branch_1 is not null
1002- ICEBERG_ASSIGN_OR_RAISE (auto new_branch_1,
1003- MakeAvroNodeWithFieldIds (branch_1, field));
1003+ ICEBERG_ASSIGN_OR_RAISE (auto new_branch_1, MakeAvroNodeWithFieldIds (branch_1, field));
10041004 auto new_union_node = std::make_shared<::avro::NodeUnion>();
10051005 new_union_node->addLeaf (branch_0); // null branch
10061006 new_union_node->addLeaf (new_branch_1);
10071007 return new_union_node;
10081008 } else if (!branch_0_is_null && branch_1_is_null) {
10091009 // branch_0 is not null, branch_1 is null
1010- ICEBERG_ASSIGN_OR_RAISE (auto new_branch_0,
1011- MakeAvroNodeWithFieldIds (branch_0, field));
1010+ ICEBERG_ASSIGN_OR_RAISE (auto new_branch_0, MakeAvroNodeWithFieldIds (branch_0, field));
10121011 auto new_union_node = std::make_shared<::avro::NodeUnion>();
10131012 new_union_node->addLeaf (new_branch_0);
10141013 new_union_node->addLeaf (branch_1); // null branch
@@ -1025,7 +1024,7 @@ Result<::avro::NodePtr> CreateUnionNodeWithFieldIds(const ::avro::NodePtr& origi
10251024} // namespace
10261025
10271026Result<::avro::NodePtr> MakeAvroNodeWithFieldIds (const ::avro::NodePtr& original_node,
1028- const MappedField& mapped_field) {
1027+ const MappedField& mapped_field) {
10291028 switch (original_node->type ()) {
10301029 case ::avro::AVRO_RECORD:
10311030 return CreateRecordNodeWithFieldIds (original_node, mapped_field);
@@ -1054,7 +1053,7 @@ Result<::avro::NodePtr> MakeAvroNodeWithFieldIds(const ::avro::NodePtr& original
10541053}
10551054
10561055Result<::avro::NodePtr> MakeAvroNodeWithFieldIds (const ::avro::NodePtr& original_node,
1057- const NameMapping& mapping) {
1056+ const NameMapping& mapping) {
10581057 MappedField mapped_field;
10591058 mapped_field.nested_mapping = std::make_shared<MappedFields>(mapping.AsMappedFields ());
10601059 return MakeAvroNodeWithFieldIds (original_node, mapped_field);
0 commit comments