def _update_run_metadata_field_masks(
        self, existing_run_metadata: dict, field_updates: dict
    ):
        """
        Update existing_run_metadata with the provided updates.

        The updates dict uses dot-notation keys to indicate nested fields.
        For example:
            {
                "invocations.invocation_1.completion_status.record_count": 1,
                "metrics.metric_1.completion_status.status": "PARTIALLY_COMPLETED",
                "labels": ["new_label"],
                "llm_judge_name": "j1"
            }

        Returns:
            A tuple with:
            - updated_run_metadata: the merged dictionary.
            - invocation_masks: dict mapping invocation IDs to lists of updated nested fields.
            - metric_masks: dict mapping metric IDs to lists of updated nested fields.
            - computation_masks: dict mapping computation IDs to lists of updated nested fields.
            - non_map_masks: list of top-level keys that were updated.
        """
        invocation_masks = {}
        metric_masks = {}
        computation_masks = {}
        non_map_masks = set()

        for key, value in field_updates.items():
            parts = key.split(".")

            if parts[0] in SUPPORTED_ENTRY_TYPES:
                group = parts[0]
                if len(parts) < 3:
                    raise ValueError(
                        f"Expected format '{group}.<id>.<field>', got: {key}"
                    )
                entry_id = parts[1]
                nested_field = ".".join(parts[2:])

                if (
                    group not in existing_run_metadata
                    or existing_run_metadata[group] is None
                ):
                    existing_run_metadata[group] = {}
                if entry_id not in existing_run_metadata[group]:
                    existing_run_metadata[group][entry_id] = {
                        "id": entry_id
                    }  # ensure the id is always set
                self._set_nested_value(
                    existing_run_metadata[group][entry_id],
                    nested_field.split("."),
                    value,
                )
                if group == SupportedEntryType.INVOCATIONS:
                    invocation_masks.setdefault(entry_id, []).append(
                        nested_field
                    )
                elif group == SupportedEntryType.COMPUTATIONS:
                    computation_masks.setdefault(entry_id, []).append(
                        nested_field
                    )
                elif group == SupportedEntryType.METRICS:
                    metric_masks.setdefault(entry_id, []).append(nested_field)

            elif key in RUN_METADATA_NON_MAP_FIELD_MASKS:
                existing_run_metadata[key] = value
                non_map_masks.add(key)
            else:
                if key not in RUN_ENTITY_EDITABLE_ATTRIBUTES:
                    raise ValueError(f"Unsupported key: {key}")

        return (
            existing_run_metadata,
            invocation_masks,
            metric_masks,
            computation_masks,
            list(non_map_masks),
        )

        Update existing_run_metadata with the provided updates.

        The updates dict uses dot-notation keys to indicate nested fields.
        For example:
            {
                "invocations.invocation_1.completion_status.record_count": 1,
                "metrics.metric_1.completion_status.status": "PARTIALLY_COMPLETED",
                "labels": ["new_label"],
                "llm_judge_name": "j1"
            }

        Returns:
            A tuple with:
            - updated_run_metadata: the merged dictionary.
            - invocation_masks: dict mapping invocation IDs to lists of updated nested fields.
            - metric_masks: dict mapping metric IDs to lists of updated nested fields.
            - computation_masks: dict mapping computation IDs to lists of updated nested fields.
            - non_map_masks: list of top-level keys that were updated.
        
src/connectors/snowflake/trulens/connectors/snowflake/dao/run.py