Sharmadha Sainath created ATLAS-2325:
----------------------------------------
Summary: Creating entity containing attribute of type set with
duplicate values
Key: ATLAS-2325
URL: https://issues.apache.org/jira/browse/ATLAS-2325
Project: Atlas
Issue Type: Bug
Components: atlas-core
Reporter: Sharmadha Sainath
Creating an entity having an attribute of type set with duplicate values is
expected to have only unique values. But duplicate values are retained.
Example : POSTing [1,2,3,1] stored as [1,2,3,1]. Expected is [1,2,3]
Repro :
1. POST the following JSON to /api/atlas/v2/types/typedefs
{code}
{
"enumDefs":[
],
"structDefs":[
],
"classificationDefs":[
],
"entityDefs":[
{
"superTypes":[
],
"attributeDefs":[
{
"name":"type_set",
"typeName":"array<string>",
"isOptional":true,
"cardinality":"SET",
"valuesMinCount":-1,
"valuesMaxCount":-1,
"isUnique":false,
"isIndexable":false
}
],
"category":"ENTITY",
"guid":"kcdnvdsvsdvidnvidsonvosid",
"createdBy":"USER",
"updatedBy":"USER",
"createTime":12345,
"updateTime":12345,
"version":12345,
"name":"simple_entity_type_set",
"description":"simple_entity_type_set",
"typeVersion":"0.1"
}
]
}
{code}
2. Create entity of the type
{code}
"referredEntities":{},
"entity":{
"typeName":"simple_entity_type_set",
"attributes":{
"type_set":["a","a","b"]
},
"guid":"-1",
"status":"ACTIVE",
"createdBy":"admin",
"updatedBy":"admin",
"createTime":1489585008165,
"updateTime":1489585008801,
"version":0,
"classifications":[],
"superTypes":[]
}
}
{code}
3. entity is created with value for type_set as [a,a,b] instead of [a,b]
This is a regression in V1 APIs and seen in V2 APIs too.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)