[ 
https://issues.apache.org/jira/browse/ATLAS-5198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aditya Gupta updated ATLAS-5198:
--------------------------------
    Description: 
{*}#Logs improvement for create/update flow{*}{*}{*}{*}{*}

*#Validating relationships logs added for invalid relationship, aren’t helpful*

*Steps:*

*//create a custom type-def*

curl -X POST "http://localhost:21000/api/atlas/v2/types/typedefs"; \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-XSRF-HEADER: dg1ZWiNhHoWPxIDS36oU" \
  -b "ATLASSESSIONID=node0ntx3x3ufshw112hdwbbtkrerq1.node0" \
  -d '{
    "entityDefs": [
     

{         "name": "hive_tableeeeeeeeeeeeeeee",         "description": "Custom 
hive table entity type for testing relationship",         "superTypes": [       
    "DataSet"         ],         "attributeDefs": []       }

    ]
  }'

 

*//create a custom relationshipDef*
curl -X POST 'http://localhost:21000/api/atlas/v2/types/typedefs' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-XSRF-HEADER: dg1ZWiNhHoWPxIDS36oU' \
  -b 'ATLASSESSIONID=node0ntx3x3ufshw112hdwbbtkrerq1.node0' \
  -d '{
    "enumDefs": [],
    "structDefs": [],
    "classificationDefs": [],
    "entityDefs": [],
    "relationshipDefs": [
      {
        "name": "table_to_table_lineage3",
        "description": "Custom lineage relationship between hive tables",
        "relationshipCategory": "ASSOCIATION",
        "propagateTags": "NONE",
        "endDef1":

{           "type": "hive_table",           "name": "sourceTables",           
"cardinality": "SET",           "isContainer": false,           
"isLegacyAttribute": false         }

,
        "endDef2":

{           "type": "hive_tableeeeeeeeeeeeeeee",           "name": 
"targetTables",           "cardinality": "SET",           "isContainer": false, 
          "isLegacyAttribute": false         }

      }
    ]
  }'

 

*//Already created 2 hive_table entities:* 
[0f689e3d-12f8-4b46-85e8-d255433d2946, bbe13a13-f18c-4de8-8334-7e2914959419]

*//Create relationship betwwen 2 hive entities*

    curl -X POST 'http://localhost:21000/api/atlas/v2/relationship' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-XSRF-HEADER: dg1ZWiNhHoWPxIDS36oU' \
  -b 'ATLASSESSIONID=node0ntx3x3ufshw112hdwbbtkrerq1.node0' \
  -d '{
    "typeName": "table_to_table_lineage3",
    "end1":

{       "guid": "0f689e3d-12f8-4b46-85e8-d255433d2946"     }

,
    "end2":

{       "guid": "bbe13a13-f18c-4de8-8334-7e2914959419"     }

  }'

 

*//Getting Error:*

{"errorCode":"ATLAS-400-00-036","errorMessage":"invalid relationshipDef: 
table_to_table_lineage3: actual end types: [hive_table, hive_table], expected 
end types: [hive_table, hive_tableeeeeeeeeeeeeeee]"}

  was:
Steps:

//create a custom type-def

curl -X POST "http://localhost:21000/api/atlas/v2/types/typedefs"; \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-XSRF-HEADER: dg1ZWiNhHoWPxIDS36oU" \
  -b "ATLASSESSIONID=node0ntx3x3ufshw112hdwbbtkrerq1.node0" \
  -d '{
    "entityDefs": [
      {
        "name": "hive_tableeeeeeeeeeeeeeee",
        "description": "Custom hive table entity type for testing relationship",
        "superTypes": [
          "DataSet"
        ],
        "attributeDefs": []
      }
    ]
  }'

 

//create a custom relationshipDef
curl -X POST 'http://localhost:21000/api/atlas/v2/types/typedefs' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-XSRF-HEADER: dg1ZWiNhHoWPxIDS36oU' \
  -b 'ATLASSESSIONID=node0ntx3x3ufshw112hdwbbtkrerq1.node0' \
  -d '{
    "enumDefs": [],
    "structDefs": [],
    "classificationDefs": [],
    "entityDefs": [],
    "relationshipDefs": [
      {
        "name": "table_to_table_lineage3",
        "description": "Custom lineage relationship between hive tables",
        "relationshipCategory": "ASSOCIATION",
        "propagateTags": "NONE",
        "endDef1": {
          "type": "hive_table",
          "name": "sourceTables",
          "cardinality": "SET",
          "isContainer": false,
          "isLegacyAttribute": false
        },
        "endDef2": {
          "type": "hive_tableeeeeeeeeeeeeeee",
          "name": "targetTables",
          "cardinality": "SET",
          "isContainer": false,
          "isLegacyAttribute": false
        }
      }
    ]
  }'

 

//Already created 2 hive_table entities: [0f689e3d-12f8-4b46-85e8-d255433d2946, 
bbe13a13-f18c-4de8-8334-7e2914959419]

//Create relationship betwwen 2 hive entities

    curl -X POST 'http://localhost:21000/api/atlas/v2/relationship' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-XSRF-HEADER: dg1ZWiNhHoWPxIDS36oU' \
  -b 'ATLASSESSIONID=node0ntx3x3ufshw112hdwbbtkrerq1.node0' \
  -d '{
    "typeName": "table_to_table_lineage3",
    "end1": {
      "guid": "0f689e3d-12f8-4b46-85e8-d255433d2946"
    },
    "end2": {
      "guid": "bbe13a13-f18c-4de8-8334-7e2914959419"
    }
  }'

 

//Getting Error:

{"errorCode":"ATLAS-400-00-036","errorMessage":"invalid relationshipDef: 
table_to_table_lineage3: actual end types: [hive_table, hive_table], expected 
end types: [hive_table, hive_tableeeeeeeeeeeeeeee]"}


> Review and Improve logging of create/update entity flow
> -------------------------------------------------------
>
>                 Key: ATLAS-5198
>                 URL: https://issues.apache.org/jira/browse/ATLAS-5198
>             Project: Atlas
>          Issue Type: Bug
>            Reporter: Aditya Gupta
>            Assignee: Aditya Gupta
>            Priority: Major
>
> {*}#Logs improvement for create/update flow{*}{*}{*}{*}{*}
> *#Validating relationships logs added for invalid relationship, aren’t 
> helpful*
> *Steps:*
> *//create a custom type-def*
> curl -X POST "http://localhost:21000/api/atlas/v2/types/typedefs"; \
>   -H "Content-Type: application/json" \
>   -H "Accept: application/json" \
>   -H "X-XSRF-HEADER: dg1ZWiNhHoWPxIDS36oU" \
>   -b "ATLASSESSIONID=node0ntx3x3ufshw112hdwbbtkrerq1.node0" \
>   -d '{
>     "entityDefs": [
>      
> {         "name": "hive_tableeeeeeeeeeeeeeee",         "description": "Custom 
> hive table entity type for testing relationship",         "superTypes": [     
>       "DataSet"         ],         "attributeDefs": []       }
>     ]
>   }'
>  
> *//create a custom relationshipDef*
> curl -X POST 'http://localhost:21000/api/atlas/v2/types/typedefs' \
>   -H 'Content-Type: application/json' \
>   -H 'Accept: application/json' \
>   -H 'X-XSRF-HEADER: dg1ZWiNhHoWPxIDS36oU' \
>   -b 'ATLASSESSIONID=node0ntx3x3ufshw112hdwbbtkrerq1.node0' \
>   -d '{
>     "enumDefs": [],
>     "structDefs": [],
>     "classificationDefs": [],
>     "entityDefs": [],
>     "relationshipDefs": [
>       {
>         "name": "table_to_table_lineage3",
>         "description": "Custom lineage relationship between hive tables",
>         "relationshipCategory": "ASSOCIATION",
>         "propagateTags": "NONE",
>         "endDef1":
> {           "type": "hive_table",           "name": "sourceTables",           
> "cardinality": "SET",           "isContainer": false,           
> "isLegacyAttribute": false         }
> ,
>         "endDef2":
> {           "type": "hive_tableeeeeeeeeeeeeeee",           "name": 
> "targetTables",           "cardinality": "SET",           "isContainer": 
> false,           "isLegacyAttribute": false         }
>       }
>     ]
>   }'
>  
> *//Already created 2 hive_table entities:* 
> [0f689e3d-12f8-4b46-85e8-d255433d2946, bbe13a13-f18c-4de8-8334-7e2914959419]
> *//Create relationship betwwen 2 hive entities*
>     curl -X POST 'http://localhost:21000/api/atlas/v2/relationship' \
>   -H 'Content-Type: application/json' \
>   -H 'Accept: application/json' \
>   -H 'X-XSRF-HEADER: dg1ZWiNhHoWPxIDS36oU' \
>   -b 'ATLASSESSIONID=node0ntx3x3ufshw112hdwbbtkrerq1.node0' \
>   -d '{
>     "typeName": "table_to_table_lineage3",
>     "end1":
> {       "guid": "0f689e3d-12f8-4b46-85e8-d255433d2946"     }
> ,
>     "end2":
> {       "guid": "bbe13a13-f18c-4de8-8334-7e2914959419"     }
>   }'
>  
> *//Getting Error:*
> {"errorCode":"ATLAS-400-00-036","errorMessage":"invalid relationshipDef: 
> table_to_table_lineage3: actual end types: [hive_table, hive_table], expected 
> end types: [hive_table, hive_tableeeeeeeeeeeeeeee]"}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to