You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Shwetha G S (JIRA)" <ji...@apache.org> on 2016/01/07 08:08:39 UTC

[jira] [Commented] (ATLAS-416) Entity creation with same entity name returns empty guid

    [ https://issues.apache.org/jira/browse/ATLAS-416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15086954#comment-15086954 ] 

Shwetha G S commented on ATLAS-416:
-----------------------------------

Entity create API is a batch API and can accept set of entities or nested entities. So, the single API can potentially create multiple entities and hence it didn't make sense to return just one entity definition in the response. The API returns the GUIDs of all entities that are created as part of the API.

Entity create API also does de-duping on a unique attribute of the type. So, in the case that there is another entity with the same unique attribute value, the create API is a no-op and hence doesn't return any GUID. There is also an API to get entity definition given the unique attribute value. Does that work for you [~patel_satya]?

> Entity creation with same entity name returns empty guid 
> ---------------------------------------------------------
>
>                 Key: ATLAS-416
>                 URL: https://issues.apache.org/jira/browse/ATLAS-416
>             Project: Atlas
>          Issue Type: Bug
>    Affects Versions: 0.6-incubating
>            Reporter: Satya Narayan
>
> Create entity is returning empty guid if entity with same name already exists.
> This use to work earlier. If we create entity with same name it returns empty guid id in the response(earlier it use to return entity definition).
> URL : http://localhost:21000/api/atlas/entities
> Request 1: 
> -----------------------------------------------------------------------------
> {code:javascript}
> [{
> 	"jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
> 	"id": {
> 		"jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
> 		"id": "-66131262182621",
> 		"version": 0,
> 		"typeName": "DATASOURCE"
> 	},
> 	"typeName": "DATASOURCE",
> 	"values": {
> 		"name": "HBASEDataSource",
> 		"description": "Data Source to connect HBASE",
> 		"InstanceName": "HBASEDataSource",
> 		"packageName": "org.test.discover.hbase",
> 		"options": "",
> 		"createdTime": "4 Jan, 2016 2:10:35 PM",
> 		"operation": "",
> 		"isDeleted": "false",
> 		"content": "hdfs:\/\/NAMENODE\/FILE_LOCATION;",
> 		"createdBy": "test",
> 		"updatedTime": "4 Jan, 2016 2:10:35 PM",
> 		"updatedBy": "test"
> 	},
> 	"traitNames": [],
> 	"traits": {}
> }]
> {code}
> ------------------------------------
> Response 1:
> -----------------------------------------
> {code:javascript}
> {
> 	"requestId": "qtp592179046-145 - a38d7453-efe1-4470-9df8-bc296b83b653",
> 	"GUID": ["1bfd13aa-b1ff-4ca8-9755-f760b59c009f"],
> 	"definition": {
> 		"jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
> 		"id": {
> 			"jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
> 			"id": "1bfd13aa-b1ff-4ca8-9755-f760b59c009f",
> 			"version": 0,
> 			"typeName": "DATASOURCE"
> 		},
> 		"typeName": "DATASOURCE",
> 		"values": {
> 			"name": "HBASEDataSource",
> 			"description": "Data Source to connect HBASE",
> 			"InstanceName": "HBASEDataSource",
> 			"DataSet.DATASOURCE.description": null,
> 			"packageName": "org.test.discover.hbase",
> 			"options": null,
> 			"createdTime": "4 Jan, 2016 2:10:35 PM",
> 			"operation": null,
> 			"isDeleted": "false",
> 			"locationUri": null,
> 			"content": "hdfs:\/\/NAMENODE\/FILE_LOCATION;",
> 			"createdBy": "test",
> 			"updatedTime": "4 Jan, 2016 2:10:35 PM",
> 			"updatedBy": "test"
> 		},
> 		"traitNames": [],
> 		"traits": {}
> 	}
> }
> {code}
> Request 2:
> Above request with diff "packageName" attribute
> Response 2: 
> GUID array is coming empty
> {code:javascript}
> {
> 	"requestId": "qtp592179046-115 - 2b98e55d-db47-446c-8db2-2c31843eca29",
> 	"GUID": []
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)