Ayub Pathan created ATLAS-2311:
----------------------------------

             Summary: Relationship GET api fails
                 Key: ATLAS-2311
                 URL: https://issues.apache.org/jira/browse/ATLAS-2311
             Project: Atlas
          Issue Type: Bug
          Components:  atlas-core
    Affects Versions: 1.0.0
            Reporter: Ayub Pathan
            Priority: Critical
             Fix For: 1.0.0


Relationship GET api fails

* create simple hive table
{noformat}
apathan@Ayub-sys-101:~/Downloads > curl 
'http://ctr-e135-1512069032975-24737-01-000003.hwx.site:21000/api/atlas/v2/entity/guid/4dcd5ddb-b989-4b11-bcda-54b518e60b98?_=1513162047823'
 -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9' -H 
'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel 
Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 
Safari/537.36' -H 'Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8'
 -H 'Cache-Control: max-age=0' -H 'Cookie: 
ATLASSESSIONID=8zvyxbzmb16l1tdpb2w1qzxrp' -H 'Connection: keep-alive' 
--compressed | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6017    0  6017    0     0   5450      0 --:--:--  0:00:01 --:--:--  5455
{
    "entity": {
        "attributes": {
            "aliases": null,
            "columns": [
                {
                    "guid": "e3832ba0-2d5e-4c9b-b33b-81b73064798f",
                    "typeName": "hive_column"
                },
                {
                    "guid": "069af03f-d257-441e-9993-98ee463076c6",
                    "typeName": "hive_column"
                }
            ],
            "comment": null,
            "createTime": 1513160887000,
            "db": {
                "guid": "e4e295df-f002-484e-b53e-bbdc9dd920e0",
                "typeName": "hive_db"
            },
            "description": null,
            "lastAccessTime": 1513160887000,
            "name": "t2",
            "owner": "anonymous",
            "parameters": {
                "COLUMN_STATS_ACCURATE": "{\"BASIC_STATS\":\"true\"}",
                "numFiles": "0",
                "numRows": "0",
                "rawDataSize": "0",
                "totalSize": "0",
                "transient_lastDdlTime": "1513160887"
            },
            "partitionKeys": null,
            "qualifiedName": "default.t2@cl1",
            "retention": 0,
            "sd": {
                "guid": "07c32764-9c1a-4360-be12-6b681409c2eb",
                "typeName": "hive_storagedesc"
            },
            "tableType": "MANAGED_TABLE",
            "temporary": false,
            "viewExpandedText": null,
            "viewOriginalText": null
        },
        "classifications": [],
        "createTime": 1513160888355,
        "createdBy": "anonymous",
        "guid": "4dcd5ddb-b989-4b11-bcda-54b518e60b98",
        "relationshipAttributes": {
            "alsoKnownAs": [],
            "columns": [
                {
                    "displayText": "a",
                    "guid": "e3832ba0-2d5e-4c9b-b33b-81b73064798f",
                    "relationshipAttributes": {
                        "typeName": "hive_table_columns"
                    },
                    "relationshipGuid": "d8882a22-ce59-4930-80b1-f0a21c8b565a",
                    "typeName": "hive_column"
                },
                {
                    "displayText": "b",
                    "guid": "069af03f-d257-441e-9993-98ee463076c6",
                    "relationshipAttributes": {
                        "typeName": "hive_table_columns"
                    },
                    "relationshipGuid": "825586ff-40a2-4574-93b1-8178227d13bf",
                    "typeName": "hive_column"
                }
            ],
            "db": {
                "displayText": "default",
                "guid": "e4e295df-f002-484e-b53e-bbdc9dd920e0",
                "relationshipAttributes": {
                    "typeName": "hive_db_tables"
                },
                "relationshipGuid": "f2c19451-95d9-4f94-b18d-00d37222e60a",
                "typeName": "hive_db"
            },
            "embeddedMetadata": [],
            "externalReferences": [],
            "knownLocations": [],
            "managedResources": [],
            "meanings": [],
            "partitionKeys": [],
            "relatedEntity": null,
            "sd": {
                "displayText": "default.t2@cl1_storage",
                "guid": "07c32764-9c1a-4360-be12-6b681409c2eb",
                "relationshipAttributes": {
                    "typeName": "hive_table_storagedesc"
                },
                "relationshipGuid": "7885a093-582d-45e3-9218-ff584bea7dcd",
                "typeName": "hive_storagedesc"
            },
            "sinkFromProcesses": [
                {
                    "displayText": "create table t2 as select * from t1",
                    "guid": "efaaf926-4972-4c59-84b2-b1c99be00452",
                    "relationshipAttributes": {
                        "typeName": "process_dataset_outputs"
                    },
                    "relationshipGuid": "eabc4601-290f-44ca-b3d0-f5cb7c7d0c48",
                    "typeName": "hive_process"
                }
            ],
            "sourceToProcesses": []
        },
        "status": "ACTIVE",
        "typeName": "hive_table",
        "updateTime": 1513160889665,
        "updatedBy": "anonymous",
        "version": 0
    },
    "referredEntities": {
        "069af03f-d257-441e-9993-98ee463076c6": {
            "attributes": {
                "comment": null,
                "description": null,
                "name": "b",
                "owner": "anonymous",
                "position": 1,
                "qualifiedName": "default.t2.b@cl1",
                "table": {
                    "guid": "4dcd5ddb-b989-4b11-bcda-54b518e60b98",
                    "typeName": "hive_table"
                },
                "type": "int"
            },
            "classifications": [],
            "createTime": 1513160888355,
            "createdBy": "anonymous",
            "guid": "069af03f-d257-441e-9993-98ee463076c6",
            "relationshipAttributes": {
                "alsoKnownAs": [],
                "embeddedMetadata": [],
                "externalReferences": [],
                "knownLocations": [],
                "managedResources": [],
                "meanings": [],
                "relatedEntity": null,
                "sinkFromProcesses": [
                    {
                        "displayText": "create table t2 as select * from t1:b",
                        "guid": "c3c8c2f6-7989-461b-ad65-f30decbc3518",
                        "relationshipAttributes": {
                            "typeName": "process_dataset_outputs"
                        },
                        "relationshipGuid": 
"522c616b-1d4a-4fb0-a4bf-41b75a211bc6",
                        "typeName": "hive_column_lineage"
                    }
                ],
                "sourceToProcesses": [],
                "table": {
                    "displayText": "t2",
                    "guid": "4dcd5ddb-b989-4b11-bcda-54b518e60b98",
                    "relationshipAttributes": {
                        "typeName": "hive_table_columns"
                    },
                    "relationshipGuid": "79ef69d0-7a12-4e5c-8e7d-eb663504f44d",
                    "typeName": "hive_table"
                }
            },
            "status": "ACTIVE",
            "typeName": "hive_column",
            "updateTime": 1513160889665,
            "updatedBy": "anonymous",
            "version": 0
        },
        "07c32764-9c1a-4360-be12-6b681409c2eb": {
            "attributes": {
                "bucketCols": null,
                "compressed": false,
                "inputFormat": "org.apache.hadoop.mapred.TextInputFormat",
                "location": "hdfs://mycluster/apps/hive/warehouse/t2",
                "numBuckets": -1,
                "outputFormat": 
"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat",
                "parameters": null,
                "qualifiedName": "default.t2@cl1_storage",
                "serdeInfo": {
                    "attributes": {
                        "name": null,
                        "parameters": {
                            "serialization.format": "1"
                        },
                        "serializationLib": 
"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"
                    },
                    "typeName": "hive_serde"
                },
                "sortCols": null,
                "storedAsSubDirectories": false,
                "table": {
                    "guid": "4dcd5ddb-b989-4b11-bcda-54b518e60b98",
                    "typeName": "hive_table"
                }
            },
            "classifications": [],
            "createTime": 1513160888355,
            "createdBy": "anonymous",
            "guid": "07c32764-9c1a-4360-be12-6b681409c2eb",
            "relationshipAttributes": {
                "alsoKnownAs": [],
                "embeddedMetadata": [],
                "externalReferences": [],
                "managedResources": [],
                "meanings": [],
                "relatedEntity": null,
                "table": {
                    "displayText": "t2",
                    "guid": "4dcd5ddb-b989-4b11-bcda-54b518e60b98",
                    "relationshipAttributes": {
                        "typeName": "hive_table_storagedesc"
                    },
                    "relationshipGuid": "04aeda22-968e-4e31-bd80-322277d165aa",
                    "typeName": "hive_table"
                }
            },
            "status": "ACTIVE",
            "typeName": "hive_storagedesc",
            "updateTime": 1513160889665,
            "updatedBy": "anonymous",
            "version": 0
        },
        "e3832ba0-2d5e-4c9b-b33b-81b73064798f": {
            "attributes": {
                "comment": null,
                "description": null,
                "name": "a",
                "owner": "anonymous",
                "position": 0,
                "qualifiedName": "default.t2.a@cl1",
                "table": {
                    "guid": "4dcd5ddb-b989-4b11-bcda-54b518e60b98",
                    "typeName": "hive_table"
                },
                "type": "string"
            },
            "classifications": [],
            "createTime": 1513160888355,
            "createdBy": "anonymous",
            "guid": "e3832ba0-2d5e-4c9b-b33b-81b73064798f",
            "relationshipAttributes": {
                "alsoKnownAs": [],
                "embeddedMetadata": [],
                "externalReferences": [],
                "knownLocations": [],
                "managedResources": [],
                "meanings": [],
                "relatedEntity": null,
                "sinkFromProcesses": [
                    {
                        "displayText": "create table t2 as select * from t1:a",
                        "guid": "313751d2-754d-4d92-b56c-8aa295ab3ea8",
                        "relationshipAttributes": {
                            "typeName": "process_dataset_outputs"
                        },
                        "relationshipGuid": 
"e1e00b1f-4671-4618-ba13-cf29ad024f5f",
                        "typeName": "hive_column_lineage"
                    }
                ],
                "sourceToProcesses": [],
                "table": {
                    "displayText": "t2",
                    "guid": "4dcd5ddb-b989-4b11-bcda-54b518e60b98",
                    "relationshipAttributes": {
                        "typeName": "hive_table_columns"
                    },
                    "relationshipGuid": "bae6f55d-8ddf-4952-929f-0cec5f044a2c",
                    "typeName": "hive_table"
                }
            },
            "status": "ACTIVE",
            "typeName": "hive_column",
            "updateTime": 1513160889665,
            "updatedBy": "anonymous",
            "version": 0
        }
    }
}
{noformat}

* Try to get the relationship definition on one of its composite entities using 
guid(for a column example)
{noformat}
apathan@Ayub-sys-101:~/Downloads > curl -v 
'http://ctr-e135-1512069032975-24737-01-000003.hwx.site:21000/api/atlas/v2/relationship/guid/d8882a22-ce59-4930-80b1-f0a21c8b565a'
 -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9' -H 
'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel 
Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 
Safari/537.36' -H 'Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8'
 -H 'Cache-Control: max-age=0' -H 'Cookie: 
ATLASSESSIONID=8zvyxbzmb16l1tdpb2w1qzxrp' -H 'Connection: keep-alive' 
--compressed
*   Trying 172.27.25.203...
* Connected to ctr-e135-1512069032975-24737-01-000003.hwx.site (172.27.25.203) 
port 21000 (#0)
> GET /api/atlas/v2/relationship/guid/d8882a22-ce59-4930-80b1-f0a21c8b565a 
> HTTP/1.1
> Host: ctr-e135-1512069032975-24737-01-000003.hwx.site:21000
> Accept-Encoding: gzip, deflate
> Accept-Language: en-US,en;q=0.9
> Upgrade-Insecure-Requests: 1
> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) 
> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
> Accept: 
> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
> Cache-Control: max-age=0
> Cookie: ATLASSESSIONID=8zvyxbzmb16l1tdpb2w1qzxrp
> Connection: keep-alive
>
< HTTP/1.1 404 Not Found
< Date: Wed, 13 Dec 2017 11:02:11 GMT
< X-Frame-Options: DENY
< Content-Type: application/json; charset=UTF-8
< Transfer-Encoding: chunked
< Server: Jetty(9.3.14.v20161028)
<
* Connection #0 to host ctr-e135-1512069032975-24737-01-000003.hwx.site left 
intact
{"errorCode":"ATLAS-404-00-00C","errorMessage":"Given relationship guid 
d8882a22-ce59-4930-80b1-f0a21c8b565a is invalid/not 
found"}apathan@Ayub-sys-101:~/Downloads >
{noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to