Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

create a relationship between 2 types in Atlas

create a relationship between 2 types in Atlas

New Contributor

In Atlas, I want to create a relationship between 2 types like the relationship between Hive_db and Hive_Table (parent-children). I created the 2 types and the relationship between them. When I create an instane of the child type, the child object (kza_rdbms_table_1) is created but the link (db) to the parent object is not created. I do not know what's missing. My code is as follows:

-------------------------

{

"enumDefs": [],

"structDefs": [],

"classificationDefs": [],

"entityDefs": [

{

"name": "kza_rdbms_db",

"description": "a database (schema) in an rdbms",

"superTypes": ["DataSet"],

"serviceType": "rdbms",

"typeVersion": "1.1",

"attributeDefs": [

{

"name": "prodOrOther",

"typeName": "string",

"isOptional": true,

"cardinality": "SINGLE",

"isUnique": false,

"isIndexable": true

},

{

"name": "contact_info",

"typeName": "string",

"isOptional": true,

"cardinality": "SINGLE",

"isUnique": false,

"isIndexable": false

}

]

},

{

"name": "kza_rdbms_table",

"description": "a table in an rdbms database (schema)",

"superTypes": ["DataSet"],

"serviceType": "rdbms",

"typeVersion": "1.2",

"options": {

"schemaElementsAttribute": "columns"

},

"attributeDefs": [

{

"name": "name_path",

"typeName": "string",

"isOptional": true,

"cardinality": "SINGLE",

"isUnique": false,

"isIndexable": false

}

]

}

],

"relationshipDefs": [

{

"name": "kza_rdbms_db_tables",

"serviceType": "rdbms",

"typeVersion": "1.2",

"relationshipCategory": "COMPOSITION",

"relationshipLabel": "__kza_rdbms_db.tables",

"endDef1": {

"type": "kza_rdbms_db",

"name": "tables",

"isContainer": true,

"cardinality": "SET",

"isLegacyAttribute": true

},

"endDef2": {

"type": "kza_rdbms_table",

"name": "db",

"isContainer": false,

"cardinality": "SINGLE",

"isLegacyAttribute": true

},

"propagateTags": "NONE"

}

]

}


----------------- instance of parent ---------------------


{

"entity":

{

"status": "ACTIVE",

"version": 1,

"typeName": "kza_rdbms_db",

"attributes": {

"name": "kza_rdbms_db_1",

"qualifiedName": "kza_rdbms_db_1_v1.0",

"prodOrOther":"prod",

"contact_info":"test"


}

}

}


------- instance of child ------------


{

"entity":

{

"status": "ACTIVE",

"version": 1,

"typeName": "kza_rdbms_table",

"attributes": {

"name": "kza_rdbms_table_1",

"qualifiedName": "kza_rdbms_table_1_v1.0",

"name_path": "d://work",

"db": {"typeName":"kza_rdbms_db", "guid":"93e6e8c2-5635-4d4c-9686-a250425e4014"}

}

}

}

Don't have an account?
Coming from Hortonworks? Activate your account here