def _create_update_statement_for_updating_numeric_and_numeric_map_field(
        self,
        numeric_type: Type[Union[int, float]],
        numeric_field_map: Dict[str, Union[int, float]],
        original_doc: Optional[SemiStructuredVespaDocument],
        vespa_fields: Dict[str, Any],
        vespa_field_types: Dict[str, Any]
    ) -> bool:
        """Creates update statements for numeric fields and their type metadata in Vespa documents.
        
        Processes numeric fields (integers, floats, int maps or float maps) for partial document updates in a semi-structured
        Vespa index. The method handles both regular numeric fields and map-type fields,
        comparing new values with the original document to minimize unnecessary updates.
        
        Args:
            numeric_type: The numeric type to process (int or float)
            numeric_field_map: Dictionary of field names to their numeric values for updating
            original_doc: The original Vespa document if it exists (for comparison)
            vespa_fields: Dictionary to store the generated Vespa update statements
            vespa_field_types: Dictionary to store field type metadata, later used to create pre-conditions
            
        Returns:
            bool: True if any fields were changed, False otherwise
            
        Behavior:
        1. Iterate over the numeric_field_map and create update statements for the fields
        that are present in the update request. This is only done if the field doesn't exist in the original document or if the field value has changed.
        2. Also create update (i.e "assign") statements for the field type metadata, which are useful in the case of a new field being added.
        3. Then iterate over the original fields which is a dictionary of all the fields inside marqo__int_fields / marqo__float_fields
        4. During this iteration, create "remove" statements for the fields that are not in numeric_field_map and are of type int_map / float_map. This is done solely
        for map fields to support complete map replacement (i.e replace an existing map with a new map of the same name but entirely different keys & values)
        """
        fields_changed = False
        field_prefix = common.INT_FIELDS if numeric_type is int else common.FLOAT_FIELDS

        original_fields = {}
        if original_doc is not None:
            original_fields = (original_doc.fixed_fields.int_fields # Get original fields if document exists
                             if numeric_type is int
                             else original_doc.fixed_fields.float_fields)

        # Process fields in update request
        for field_name, field_value in numeric_field_map.items():
            if not isinstance(field_value, numeric_type):
                continue
                
            vespa_field_name = f'{field_prefix}{{{field_name}}}'
            vespa_field_types_field_name = f'{common.VESPA_DOC_FIELD_TYPES}{{{field_name}}}'

            # Only set field value if it doesn't exist in the original set of fields or has changed
            field_exists_in_original_doc = original_doc is not None and field_name in original_fields
            field_value_changed = field_exists_in_original_doc and original_fields[field_name] != field_value
            field_type = vespa_field_types.get(field_name) # Get field type from the field passed in the request

            if not field_exists_in_original_doc or field_value_changed:
                vespa_fields[vespa_field_name] = {"assign": field_value} # assign statement for adding / updating the field value in marqo__int_fields / marqo__float_fields

                # Set field type metadata by creating an assign statement
                vespa_fields[vespa_field_types_field_name] = {"assign": field_type} # assign statement for adding / updating the field type in marqo__field_types
                
                # Handle creating update statements for the map field name. 
                if "." in field_name:
                    # For fields like "map1.key1", extract the map name "map1"
                    map_name = self._extract_map_name_from_field(field_name)
                    # Create assign statement for adding / updating statement for the map field. This is done for the prefix in a flattened map field name.
                    vespa_fields[f'{common.VESPA_DOC_FIELD_TYPES}{{{map_name}}}'] = {"assign": vespa_field_types.get(map_name)}

                fields_changed = True

        # Remove fields no longer in map

        # This block of code only executes for map fields. This is because to replace an entire map, we need to remove the flattened keys that
        # from marqo__int_fields / marqo__float_fields in case those fields are not present in the update request.
        for original_field_name in original_fields:
            if (original_field_name not in numeric_field_map and
                original_doc.fixed_fields.field_types.get(original_field_name) in (MarqoFieldTypes.INT_MAP.value, MarqoFieldTypes.FLOAT_MAP.value)):

                map_name = self._extract_map_name_from_field(original_field_name)
                vespa_field_name = f'{field_prefix}{{{original_field_name}}}'
                vespa_field_types_field_name = f'{common.VESPA_DOC_FIELD_TYPES}{{{original_field_name}}}'

                vespa_fields[vespa_field_name] = {"remove": 0} # remove statement for removing the field from marqo__int_fields / marqo__float_fields
                vespa_fields[vespa_field_types_field_name] = {"remove": 0} # remove statement for removing the field from marqo__field_types.
                vespa_field_types.pop(original_field_name, None)

                if vespa_field_types.get(map_name) is None: # Remove statement for removing the map field from marqo__field_types. This is prefix for a flattened map field.
                    vespa_fields[f'{common.VESPA_DOC_FIELD_TYPES}{{{map_name}}}'] = {"remove": 0}
                    
                fields_changed = True

        return fields_changed
Creates update statements for numeric fields and their type metadata in Vespa documents.
        
        Processes numeric fields (integers, floats, int maps or float maps) for partial document updates in a semi-structured
        Vespa index. The method handles both regular numeric fields and map-type fields,
        comparing new values with the original document to minimize unnecessary updates.
        
        Args:
            numeric_type: The numeric type to process (int or float)
            numeric_field_map: Dictionary of field names to their numeric values for updating
            original_doc: The original Vespa document if it exists (for comparison)
            vespa_fields: Dictionary to store the generated Vespa update statements
            vespa_field_types: Dictionary to store field type metadata, later used to create pre-conditions
            
        Returns:
            bool: True if any fields were changed, False otherwise
            
        Behavior:
        1. Iterate over the numeric_field_map and create update statements for the fields
        that are present in the update request. This is only done if the field doesn't exist in the original document or if the field value has changed.
        2. Also create update (i.e "assign") statements for the field type metadata, which are useful in the case of a new field being added.
        3. Then iterate over the original fields which is a dictionary of all the fields inside marqo__int_fields / marqo__float_fields
        4. During this iteration, create "remove" statements for the fields that are not in numeric_field_map and are of type int_map / float_map. This is done solely
        for map fields to support complete map replacement (i.e replace an existing map with a new map of the same name but entirely different keys & values)
        
src/marqo/core/semi_structured_vespa_index/semi_structured_vespa_index.py