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

chaitali borole edited comment on ATLAS-2002 at 4/2/19 6:07 AM:
----------------------------------------------------------------

Hi,

I have tested the issue by hitting a REST API with below JSON

[http://latlasserverURL/api/atlas/types|http://latlasserverurl/api/atlas/types]

{noformat}

{
 "enumTypes": [],
 "structTypes": [],
 "traitTypes": [
 {
 "superTypes": [],
 "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType",
 "typeName": "Pictures",
 "typeDescription": "photography",
 "attributeDefinitions": [

{ "name": "attribute1", "dataTypeName": "string", "multiplicity": "optional", 
"isComposite": false, "isUnique": false, "isIndexable": true, 
"reverseAttributeName": null }

,

{ "name": "attribute2", "dataTypeName": "string", "multiplicity": "required", 
"isComposite": false, "isUnique": false, "isIndexable": true, 
"reverseAttributeName": null }

,

{ "name": "attribute3", "dataTypeName": "string", "multiplicity": "required", 
"isComposite": false, "isUnique": false, "isIndexable": true, 
"reverseAttributeName": null }

,

{ "name": "attribute4", "dataTypeName": "string", "multiplicity": "required", 
"isComposite": false, "isUnique": false, "isIndexable": true, 
"reverseAttributeName": null }

,

{ "name": "attribute5", "dataTypeName": "string", "multiplicity": "optional", 
"isComposite": false, "isUnique": false, "isIndexable": true, 
"reverseAttributeName": null }

]
 }
 ],
 "classTypes": []
 }

{noformat}

 

And then adding a tag to it through 
"atlasServerURL/api/atlas/entities/e0ef50ef-a16a-4767-a671-250fffa555f6/traits

{noformat}

{
 "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Struct",
 "typeName": "Pictures",
 "values":

{ "attribute1": "value1", "attribute2": "value2", "attribute3": "value3", 
"attribute4": "" }

}

{noformat}

Tag was created as well as not giving any error.


was (Author: chaitali):
Hi,

I have tested the issue by hitting a REST API with below JSON

http://latlasserverURL/api/atlas/types

{
"enumTypes": [],
"structTypes": [],
"traitTypes": [
{
"superTypes": [],
"hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType",
"typeName": "Pictures",
"typeDescription": "photography",
"attributeDefinitions": [
{
"name": "attribute1",
"dataTypeName": "string",
"multiplicity": "optional",
"isComposite": false,
"isUnique": false,
"isIndexable": true,
"reverseAttributeName": null
},
{
"name": "attribute2",
"dataTypeName": "string",
"multiplicity": "required",
"isComposite": false,
"isUnique": false,
"isIndexable": true,
"reverseAttributeName": null
},
{
"name": "attribute3",
"dataTypeName": "string",
"multiplicity": "required",
"isComposite": false,
"isUnique": false,
"isIndexable": true,
"reverseAttributeName": null
},
{
"name": "attribute4",
"dataTypeName": "string",
"multiplicity": "required",
"isComposite": false,
"isUnique": false,
"isIndexable": true,
"reverseAttributeName": null
},
{
"name": "attribute5",
"dataTypeName": "string",
"multiplicity": "optional",
"isComposite": false,
"isUnique": false,
"isIndexable": true,
"reverseAttributeName": null
}
]
}
],
"classTypes": []
}


And then adding a tag to it through 
"atlasServerURL/api/atlas/entities/e0ef50ef-a16a-4767-a671-250fffa555f6/traits

{
 "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Struct",
 "typeName": "Pictures",
 "values": {
 "attribute1": "value1",
 "attribute2": "value2",
 "attribute3": "value3",
 "attribute4": ""
 }
}

Tag was created as well as not giving any error.

> Regression Atlas 0.8- structured tag and multiplicity required
> --------------------------------------------------------------
>
>                 Key: ATLAS-2002
>                 URL: https://issues.apache.org/jira/browse/ATLAS-2002
>             Project: Atlas
>          Issue Type: Bug
>          Components:  atlas-core
>    Affects Versions: 0.8-incubating
>         Environment: HDP 2.6.1 - Atlas 0.8.0
>            Reporter: Bastien Morel
>            Assignee: chaitali borole
>            Priority: Critical
>
> Hi, 
> I created an Atlas structured tag with several attributes, some were created 
> with a required multiplicity (attributes 2, 3 and 4) and others with an 
> optional mulitplicity (attributes 1 and 5). 
> Here is the curl request that I used:
> curl -v -X POST -w '%{http_code}' -u atlasUsername:atlasPassword -d 
> '{"enumTypes":[],"structTypes":[],"traitTypes":[{"superTypes":[],"hierarchicalMetaTypeName":"org.apache
> .atlas.typesystem.types.TraitType","typeName":"structuredTagName","typeDescription":"structuredTagName","attributeDefinitions":[{"name":"attribute1","dataTypeName":
>  "string",*{color:red}"multiplicity": "optional"{color}*,"isCom
> posite": false,"isUnique": false,"isIndexable": true,"reverseAttributeName": 
> null},{"name":"attribute2","dataTypeName": 
> "string",{color:red}*"multiplicity": "required"*{color},"isComposite": 
> false,"isUnique": false,"isInde
> xable": true,"reverseAttributeName": 
> null},{"name":"attribute3","dataTypeName": 
> "string",*{color:red}"multiplicity": "required"{color}*,"isComposite": 
> false,"isUnique": false,"isIndexable": true,"reverseAttributeName": null},
> {"name":"attribute4","dataTypeName": "string",{color:red}*"multiplicity": 
> "required"*{color},"isComposite": false,"isUnique": false,"isIndexable": 
> true,"reverseAttributeName": null},{"name":"attribute5","dataTypeName": 
> "string",*{color:red}"mu
> ltiplicity": "optional"{color}*,"isComposite": false,"isUnique": 
> false,"isIndexable": true,"reverseAttributeName": null}]}],"classTypes":[]}' 
> -H 'Content-Type: application/json' atlasServerURL/api/atlas/types/
> Then, I'm creating a link between this tag and an existing Atlas entity. I 
> voluntarily did not complete the 4th attribute (I set the attribute value as 
> ""), defined as required:
> curl -v -u admin:admin -X POST -d 
> '{"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Struct","typeName":"structuredTagName","values":{"attribute1":"value1","attribute2":"value2","attribute3":"value3","attribute4":""}}'
>  -H "Content-Type: application/json" 
> "atlasServerURL/api/atlas/entities/guid/traits"
> I have this error message :
> < HTTP/1.1 400 Bad Request
> < Date: Fri, 28 Jul 2017 12:38:07 GMT
> < Set-Cookie: ATLASSESSIONID=xxx;Path=/;HttpOnly
> < Expires: Thu, 01 Jan 1970 00:00:00 GMT
> < X-Frame-Options: DENY
> < Content-Type: application/json; charset=UTF-8
> < Transfer-Encoding: chunked
> < Server: Jetty(9.2.12.v20150709)
> <
> * Connection #0 to host atlasServerURL left intact
> * Closing connection #0
> {"error":"Error deserializing trait instance"}
> Atlas found an error because of the missing attribute4 value but created the 
> tag anyway: I checked using a CURL GET request on the GUID traits ressource.
> When I used the same request in Atlas 0.5, I got the error and the tag was 
> not created. 
> Is there any possibility to correct this regression please?
> Many thanks,
> Regards,
> Bastien



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to