@@ -852,14 +852,14 @@ Result<::avro::NodePtr> CreateArrayNodeWithFieldIds(const ::avro::NodePtr& origi
852852 ICEBERG_ASSIGN_OR_RAISE (auto new_element_node,
853853 MakeAvroNodeWithFieldIds (original_node->leafAt (0 ), field));
854854 new_array_node->addLeaf (new_element_node);
855-
855+
856856 // Check and add custom attributes
857857 if (original_node->customAttributes () > 0 ) {
858858 for (auto & attr : original_node->customAttributesMap ()) {
859859 new_array_node->addCustomAttribute (attr.first , attr.second );
860860 }
861861 }
862-
862+
863863 return new_array_node;
864864 }
865865
@@ -878,7 +878,7 @@ Result<::avro::NodePtr> CreateArrayNodeWithFieldIds(const ::avro::NodePtr& origi
878878 auto new_element_node,
879879 MakeAvroNodeWithFieldIds (original_node->leafAt (0 ), element_field));
880880 new_array_node->addLeaf (new_element_node);
881-
881+
882882 // Check and add custom attributes from original node
883883 if (original_node->customAttributes () > 0 ) {
884884 for (auto & attr : original_node->customAttributesMap ()) {
@@ -935,15 +935,15 @@ Result<::avro::NodePtr> CreateMapNodeWithFieldIds(const ::avro::NodePtr& origina
935935 // Create key and value attributes
936936 ::avro::CustomAttributes key_attributes;
937937 ::avro::CustomAttributes value_attributes;
938-
938+
939939 // Add required field IDs
940940 key_attributes.addAttribute (std::string (kKeyIdProp ),
941941 std::to_string (*key_mapped_field.field_id ),
942942 /* addQuote=*/ false );
943943 value_attributes.addAttribute (std::string (kValueIdProp ),
944944 std::to_string (*value_mapped_field.field_id ),
945945 /* addQuote=*/ false );
946-
946+
947947 // Merge custom attributes from original node if they exist
948948 if (original_node->customAttributes () > 0 ) {
949949 // Merge attributes for key (index 0)
@@ -953,29 +953,31 @@ Result<::avro::NodePtr> CreateMapNodeWithFieldIds(const ::avro::NodePtr& origina
953953 for (const auto & attr_pair : existing_key_attrs) {
954954 // Skip if it's the key ID property we're already setting
955955 if (attr_pair.first != kKeyIdProp ) {
956- key_attributes.addAttribute (attr_pair.first , attr_pair.second , /* addQuote=*/ false );
956+ key_attributes.addAttribute (attr_pair.first , attr_pair.second ,
957+ /* addQuote=*/ false );
957958 }
958959 }
959960 }
960-
961+
961962 // Merge attributes for value (index 1)
962963 if (original_node->hasCustomAttributesForField (1 )) {
963964 const auto & original_value_attrs = original_node->customAttributesAt (1 );
964965 const auto & existing_value_attrs = original_value_attrs.attributes ();
965966 for (const auto & attr_pair : existing_value_attrs) {
966967 // Skip if it's the value ID property we're already setting
967968 if (attr_pair.first != kValueIdProp ) {
968- value_attributes.addAttribute (attr_pair.first , attr_pair.second , /* addQuote=*/ false );
969+ value_attributes.addAttribute (attr_pair.first , attr_pair.second ,
970+ /* addQuote=*/ false );
969971 }
970972 }
971973 }
972-
974+
973975 // Merge node-level attributes if any
974976 for (auto & attr : original_node->customAttributesMap ()) {
975977 new_map_node->addCustomAttribute (attr.first , attr.second );
976978 }
977979 }
978-
980+
979981 // Add the merged attributes to the new map node
980982 new_map_node->addCustomAttributesForField (key_attributes);
981983 new_map_node->addCustomAttributesForField (value_attributes);
0 commit comments