You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Kapildeo Nayak (JIRA)" <ji...@apache.org> on 2018/08/07 09:43:00 UTC

[jira] [Commented] (ATLAS-2257) hive_column type definition changes for position and table attributes when updated

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

Kapildeo Nayak commented on ATLAS-2257:
---------------------------------------

In class AtlasStructDefStoreV1 the method[ toJsonFromAttribute](AtlasAttribute attribute)

The value of lower and upper variable are set according to Cardinality used
 for e.g. if Cardinality is SINGLE 
 and isOptional attribute is true than lower = 0 , and upper is set = 1 by default.
 if isOptional attribute is false than lower = 1 , and upper is set = 1 by default.
 and than value of lower and upper is set for attribute multiplicity with lower and upper
 after this in method() toAttributeDefFromJson()
 the value of lower and upper is set for variable valuesMinCount and valuesMaxCount accordingly.

 

https://github.com/apache/atlas/blob/branch-0.8/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java#L469

 

If isUnique is false and Cardinality is other than SINGLE than the Cardinality is set to LIST and 
 if isUnique is true and Cardinality is other than SINGLE than the Cardinality is set to SET.
 and if Cardinality is non SINGLE and isOptional attribute is false and valuesMinCount < 1 than lower = 1 else lower is userdefined value , 
 and if Cardinality is non SINGLE and valuesMinCount < 2 than upper = Integer.MAX_VALUE else upper is userdefined value, 
 and than value of lower and upper is set for attribute multiplicity with lower and upper

after this in method() toAttributeDefFromJson()
 the value of lower and upper is set for variable valuesMinCount and valuesMaxCount accordingly.

[https://github.com/apache/atlas/blob/branch-0.8/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java#L516]

 

Its not a issue.

> hive_column type definition changes for position and table attributes when updated
> ----------------------------------------------------------------------------------
>
>                 Key: ATLAS-2257
>                 URL: https://issues.apache.org/jira/browse/ATLAS-2257
>             Project: Atlas
>          Issue Type: Bug
>          Components:  atlas-core
>            Reporter: Sharmadha Sainath
>            Priority: Major
>
> On a fresh instance of Atlas , following is the type definition of hive_column :
> {code}
> {  
>    category:"ENTITY",
>    guid:"076ceac2-5c0d-400f-8f89-ab455125191d",
>    createdBy:"atlas",
>    updatedBy:"atlas",
>    createTime:1510294855527,
>    updateTime:1510294855527,
>    version:1,
>    name:"hive_column",
>    description:"hive_column",
>    typeVersion:"1.3",
>    options:{  
>       schemaAttributes:"["      name",
>       "description",
>       "owner",
>       "type",
>       "comment",
>       "position"
>    ]   " 
> }, 
> attributeDefs: [ 
> { 
> name: "   type",
>    typeName:"string",
>    isOptional:false,
>    cardinality:"SINGLE",
>    valuesMinCount:1,
>    valuesMaxCount:1,
>    isUnique:false,
>    isIndexable:true
> },
> {  
>    name:"comment",
>    typeName:"string",
>    isOptional:true,
>    cardinality:"SINGLE",
>    valuesMinCount:0,
>    valuesMaxCount:1,
>    isUnique:false,
>    isIndexable:false
> },
> {  
>    name:"position",
>    typeName:"int",
>    isOptional:true,
>    cardinality:"SINGLE",
>    valuesMinCount:-1,
>    valuesMaxCount:-1,
>    isUnique:false,
>    isIndexable:false
> },
> {  
>    name:"table",
>    typeName:"hive_table",
>    isOptional:true,
>    cardinality:"SINGLE",
>    valuesMinCount:-1,
>    valuesMaxCount:-1,
>    isUnique:false,
>    isIndexable:false
> }
> ],
> superTypes:[  
> "DataSet"
> ]
> }
> {code}
> fired an update PUT request to update the hive_column type definition without changing the definition . Update is successful. After update , following is the type definition of hive_column :
> {code}
> {  
>    category:"ENTITY",
>    guid:"076ceac2-5c0d-400f-8f89-ab455125191d",
>    createdBy:"atlas",
>    updatedBy:"admin",
>    createTime:1510294855527,
>    updateTime:1510294918066,
>    version:5,
>    name:"hive_column",
>    description:"hive_column",
>    typeVersion:"1.3",
>    options:{  
>       schemaAttributes:"["      name",
>       "description",
>       "owner",
>       "type",
>       "comment",
>       "position"
>    ]   " 
> }, 
> attributeDefs: [ 
> { 
> name: "   type",
>    typeName:"string",
>    isOptional:false,
>    cardinality:"SINGLE",
>    valuesMinCount:1,
>    valuesMaxCount:1,
>    isUnique:false,
>    isIndexable:true
> },
> {  
>    name:"comment",
>    typeName:"string",
>    isOptional:true,
>    cardinality:"SINGLE",
>    valuesMinCount:0,
>    valuesMaxCount:1,
>    isUnique:false,
>    isIndexable:false
> },
> {  
>    name:"position",
>    typeName:"int",
>    isOptional:true,
>    cardinality:"SINGLE",
>    valuesMinCount:0,
>    valuesMaxCount:1,
>    isUnique:false,
>    isIndexable:false
> },
> {  
>    name:"table",
>    typeName:"hive_table",
>    isOptional:true,
>    cardinality:"SINGLE",
>    valuesMinCount:0,
>    valuesMaxCount:1,
>    isUnique:false,
>    isIndexable:false
> }
> ],
> superTypes:[  
> "DataSet"
> ]
> }
> {code}
> valuesMinCount and valuesMaxCount values differ for "position" and "table" attributes post update.
> Thanks [~ayubkhan] for helping to reproduce the issue .
> This issue is not seen in other data types in hive model.



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