ATLAS-5279: changes for handling rename propagation#609
Conversation
…lrconfig for newly added field and handled deleted column use-case
…lrconfig for newly added field and handled deleted column use-case
| @@ -0,0 +1,29 @@ | |||
| { | |||
There was a problem hiding this comment.
Do you need patch? since trino models are not yet released.
There was a problem hiding this comment.
As discussed offline, keeping this file to support upgrade scenarios for environments already running with the Trino setup.
| "superTypes": [ "Asset" ], | ||
| "serviceType": "trino", | ||
| "typeVersion": "1.0", | ||
| "attributeDefOverrides": [ |
There was a problem hiding this comment.
Please update to trino_columns typeDef
There was a problem hiding this comment.
updated ...please review now
| "attributeDefOverrides": [ | ||
| { | ||
| "name": "qualifiedName", | ||
| "autoComputeFormat": "{table.trinoschema.catalog.name}.{table.trinoschema.name}.{table.name}.{name}@{table.trinoschema.catalog.instance.name}" |
There was a problem hiding this comment.
Since ".name" we have hardcoded as the name attribute of a particular type in the processing os autoComputeFormat, Please highlight or create a doc, on how to add the format for an entityType
There was a problem hiding this comment.
added section "Configuring autoComputeFormat on an entity type" in readme file.
| */ | ||
| public class RenamePropagationTarget { | ||
| private final String targetTypeName; | ||
| private final RelationshipCategory category; |
There was a problem hiding this comment.
please review, if this is needed.
There was a problem hiding this comment.
removed this unused field..
| /** | ||
| * Applies {@code SET_ATTRIBUTE_DEF_OVERRIDES} on entity typedefs and {@code SET_PROPAGATE_RENAME} on relationship typedefs. | ||
| */ | ||
| static class SetAttributeDefOverridesPatchHandler extends PatchHandler { |
There was a problem hiding this comment.
Since this class handles different actions, not just SetAttributeDefOverrides, Please rename accordingly
There was a problem hiding this comment.
renamed this classed as "AttributeDefOverridesAndPropagateRenamePatchHandler"
What changes were proposed in this pull request?
Background
In Apache Atlas, when an entity such as a table or view is renamed (e.g., via hooks from systems like Trino), only the parent entity’s attributes are updated. However, dependent entities (such as columns) continue to retain the old qualifiedName, leading to inconsistency in metadata.
Since qualifiedName is a derived unique attribute that often embeds the parent entity name, any rename operation requires corresponding updates across all dependent entities to maintain correctness and lineage consistency
Problem Statement
How the patch resolves it
This patch enables Apache Atlas to automatically propagate rename changes across dependent entities, ensuring metadata consistency without relying on hooks to emit updates for every downstream entity.
Atlas derives rename propagation behavior from type definitions. It identifies downstream entities in the graph, understands how their unique attributes (typically qualifiedName) are constructed, and determines which segment of that attribute needs to change when an upstream entity is renamed.
During a partial update, when the qualifiedName of an entity changes, Atlas follows the configured relationships, recomputes the corresponding attribute for each affected dependent entity using the defined autoComputeFormat, and persists those updates within the same transaction. This ensures consistent metadata updates across the graph.
High-Level Implementation
Model & Storage
Type Initialization (resolveReferences)
Entity Update Flow (createOrUpdate / Partial Update)
Addons & Rollout
Documentation
Potential Use Cases and Extensions of This Solution
The rename propagation logic is intentionally designed to be generic and model-driven, rather than being hardcoded for specific entity types or hooks. Behavior is derived dynamically from Atlas type definitions and relationship metadata, making it extensible for future hooks and systems.
By using relationship metadata (propagateRename, propagateAttributes) and computed attribute definitions (autoComputeFormat), rename propagation can be enabled or modified through model changes without requiring Atlas core code changes. This provides a flexible foundation for consistent metadata updates across different ecosystems and entity hierarchies.
Key Use Cases Enabled
Lightweight Hooks with Reduced Event Overhead
Hooks no longer need to emit updates for every dependent entity. Atlas resolves and updates dependencies internally, reducing event volume and simplifying hook logic. (Performance/scalability trade-offs should be evaluated for this approach.)
Cross-System Rename Propagation
Enables model-driven propagation across different metadata systems and hooks (e.g., Hive → Trino).
For example, renaming a Hive table can automatically propagate updates to corresponding Trino table entities and their dependent columns, ensuring consistent qualifiedName values across systems.
Standardized Unique Attribute Definition
Provides a model-driven way to define qualifiedName formats, removing the need for system-specific hardcoded logic in hooks and ensuring consistency across entity creation and rename flows.
Selective Propagation Control
Allows explicit control over which relationships participate in rename propagation, enabling exclusion of certain dependent entities where propagation is not required.
Attribute Inheritance with Entity-Level Overrides
Establishes a baseline where derived entities can inherit attributes defined at a parent type and override them as needed.
For example, qualifiedName defined at a base type (e.g., Referenceable) can be overridden by derived entities such as Table using attributeDefOverrides, allowing entity-specific customization while preserving a consistent framework.
How was this patch tested?
Setup :
use-cases validation :
Rename Propagation Validation
Regression Testing
Create Trino table
Add column to Trino table
Rename column in Trino table
Drop column from Trino table
Drop Trino table