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

Aditya Gupta updated ATLAS-5198:
--------------------------------
    Description: 
*What Changes done?*
 * 
 -- Improved error messaging [AtlasErrorCode] for invalid relationship end 
types.*
 * {*}Added and Improved debug logging in entity create/update flows{*}{*}{{*}}

 * 
 -- 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: wXcHEM9FcgWQCjJTNDBD" \
  -b "ATLASSESSIONID=node0e8vpukcvr0fg2ak8gb1f0hlk0.node0" \
  -d '{
    "entityDefs": [
      {
        "name": "hive_table_demo3",
        "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: wXcHEM9FcgWQCjJTNDBD' \
  -b 'ATLASSESSIONID=node0e8vpukcvr0fg2ak8gb1f0hlk0.node0' \
  -d '{
    "enumDefs": [],
    "structDefs": [],
    "classificationDefs": [],
    "entityDefs": [],
    "relationshipDefs": [
      {
        "name": "table_to_table_lineage7",
        "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_table_demo3",
          "name": "targetTables",
          "cardinality": "SET",
          "isContainer": false,
          "isLegacyAttribute": false
        }
      }
    ]
  }'

 

*//Already created 2* *impala_process and hbase_table* *entities:* 
[ffe73ace-29b2-4a3d-acec-fab017797acb, 3fa0fa70-7713-4ad9-8265-548d940e0533]

*//Create relationship betwwen 2 impala_process and hbase_table entites*

    curl -X POST 'http://localhost:21000/api/atlas/v2/relationship' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-XSRF-HEADER: wXcHEM9FcgWQCjJTNDBD' \
  -b 'ATLASSESSIONID=node0e8vpukcvr0fg2ak8gb1f0hlk0.node0' \
  -d '{
    "typeName": "table_to_table_lineage7",
    "end1": {
      "guid": "ffe73ace-29b2-4a3d-acec-fab017797acb" //impala_process GUID
    },
    "end2": {
      "guid": "3fa0fa70-7713-4ad9-8265-548d940e0533" //hbase_table GUID
    }
  }'

 

*//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:
*What Changes done?*

*- Improved error messaging [AtlasErrorCode] for invalid relationship end 
types.*
 * {*}Added and Improved debug logging in entity create/update flows{*}{*}{*}

*- 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]"}


> 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
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> *What Changes done?*
>  * 
>  -- Improved error messaging [AtlasErrorCode] for invalid relationship end 
> types.*
>  * {*}Added and Improved debug logging in entity create/update 
> flows{*}{*}{{*}}
>  * 
>  -- 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: wXcHEM9FcgWQCjJTNDBD" \
>   -b "ATLASSESSIONID=node0e8vpukcvr0fg2ak8gb1f0hlk0.node0" \
>   -d '{
>     "entityDefs": [
>       {
>         "name": "hive_table_demo3",
>         "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: wXcHEM9FcgWQCjJTNDBD' \
>   -b 'ATLASSESSIONID=node0e8vpukcvr0fg2ak8gb1f0hlk0.node0' \
>   -d '{
>     "enumDefs": [],
>     "structDefs": [],
>     "classificationDefs": [],
>     "entityDefs": [],
>     "relationshipDefs": [
>       {
>         "name": "table_to_table_lineage7",
>         "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_table_demo3",
>           "name": "targetTables",
>           "cardinality": "SET",
>           "isContainer": false,
>           "isLegacyAttribute": false
>         }
>       }
>     ]
>   }'
>  
> *//Already created 2* *impala_process and hbase_table* *entities:* 
> [ffe73ace-29b2-4a3d-acec-fab017797acb, 3fa0fa70-7713-4ad9-8265-548d940e0533]
> *//Create relationship betwwen 2 impala_process and hbase_table entites*
>     curl -X POST 'http://localhost:21000/api/atlas/v2/relationship' \
>   -H 'Content-Type: application/json' \
>   -H 'Accept: application/json' \
>   -H 'X-XSRF-HEADER: wXcHEM9FcgWQCjJTNDBD' \
>   -b 'ATLASSESSIONID=node0e8vpukcvr0fg2ak8gb1f0hlk0.node0' \
>   -d '{
>     "typeName": "table_to_table_lineage7",
>     "end1": {
>       "guid": "ffe73ace-29b2-4a3d-acec-fab017797acb" //impala_process GUID
>     },
>     "end2": {
>       "guid": "3fa0fa70-7713-4ad9-8265-548d940e0533" //hbase_table GUID
>     }
>   }'
>  
> *//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