Support for validating the AttributeName in parent and child TypeDef
Atlas service validates the attribute names of the entity types for those attributes having identical names as their parents' attributes.
Previously, until the Cloudera Runtime 7.1.6 release, Atlas service did not validate the attributes of entity types which led to unpredictable situations, such as being unable to update attribute values or to assign valid values to those attributes in child types.
The checks or the validation of the attributes are performed for multiple use cases pertaining to
Entity and Classification type attribute names. Some of the common scenarios include:
- Creating Entity or Classification type having attribute name which is same as one of the attributes from its Parent type
- Updating the existing type to make it as a child of some other type, Atlas validates for the attribute names in both the types.
- Updating the existing child type by adding an attribute , enables Atlas to validate if that attribute name is already present in its parent-type attributes.
Use case 1: If the user attempts to create an Entity or Classification type having an attribute name same as one of the attributes from its parent type, the Atlas service does not allow to create a child type and throws an exception.
As an example:
Consider there is a Type "ParentType" which has attributes "attributeA", "attributeB", and "attributeC". The user wants to create a child type of this "ParentType", say "ChildType". Note that the child type should not have any of the above attributes that are indicated. If any of these attributes are included at the time of "ChildType" creation, the Atlas service does not allow the creation of "ChildType".
Use case 2: If the user attempts to update the existing type and tries to change this type as a child to another type, Atlas service verifies the attribute names in both the types. If Atlas reports that the parent and child type have the same name attributes, Atlas does not allow updating the type and raises an exception.
As an example:
Consider there are 2 types "MyType01" having attribute "attributeA" and "MyType02" also having "attributeA". Atlas does not allow updating "MyType02" to become the child type of "MyType01" (and vice versa).
Use case 3: If a user attempts to update the existing child type and tries to add any attribute in child type, the Atlas service checks if that attribute name is already present in its parent-type attributes. If the attribute is present, Atlas service does not allow adding the attribute in child type and raises an exception.
As an example:
Suppose there are 2 types: "ParentType" having attribute "attributeA" and "ChildType" which is a child of "ParentType" and having attribute "attributeB". If a user tries to update the "ChildType" by adding an attribute "attributeA" in it, Atlas service does not allow adding the attribute in the "ChildType".