-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71012/#review216602
-----------------------------------------------------------




intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java
Lines 252 (patched)
<https://reviews.apache.org/r/71012/#comment303806>

    This validation enforces that 'guid' should be specified for entities at 
both ends of the relationship. This may not be a correct assumption, as 
typename+uniqAttributes can be used identify entities at relationship ends.



repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
Line 340 (original), 340 (patched)
<https://reviews.apache.org/r/71012/#comment303807>

    Instead of sending following as parameters  to validateRelationship(), 
consider updating the method to receive only 'relationship':
     - relationship.getTypeName()
     - relationship.getAttributes()
     - relationship
    
    validateRelationship(end1Vertex, end2Vertex, relationship.getTypeName(), 
relationship.getAttributes() ,relationship) => validateRelationship(end1Vertex, 
end2Vertex, relationship)
    
    Note that #195 above needs to be updated empty/null 
relationship.getTypeName(), which can happen for legacy relationships. In such 
cases, consider updating relationship.setTypeName(edgeType) before calling 
validateRelationship() and restore the value after the call.


- Madhan Neethiraj


On July 9, 2019, 8:39 a.m., mayank jain wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71012/
> -----------------------------------------------------------
> 
> (Updated July 9, 2019, 8:39 a.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, 
> and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3310
>     https://issues.apache.org/jira/browse/ATLAS-3310
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch will provide the fix to the BigInteger attributes in relationship.
> 
> Working on Unit test case for testing BigInteger case.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasRelationshipType.java 98071b2 
>   
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
>  54059e8 
> 
> 
> Diff: https://reviews.apache.org/r/71012/diff/2/
> 
> 
> Testing
> -------
> 
> Modified the relationship attributes of hive_table and column with the below 
> mentioned API :
> link used: localhost:21000/api/atlas/v2/types/typedefs
> Request Type : PUT
> JSON : 
> {     
>           "relationshipDefs": [
>               {
>             "category": "RELATIONSHIP",
>             "guid": "8339e074-8a76-4ab6-b716-2e6a5883c158",
>             "createdBy": "mayank",
>             "updatedBy": "mayank",
>             "createTime": 1561985660068,
>             "updateTime": 1561985660068,
>             "version": 1,
>             "name": "hive_table_columns",
>             "description": "hive_table_columns",
>             "typeVersion": "1.2",
>             "serviceType": "hive",
>             "attributeDefs": [
>               {
>                     "name": "description",
>                     "typeName": "string",
>                     "isOptional": true,
>                     "cardinality": "SINGLE",
>                     "valuesMinCount": 0,
>                     "valuesMaxCount": 1,
>                     "isUnique": false,
>                     "isIndexable": true,
>                     "includeInNotification": false,
>                     "description": "A sample attr for holdig ddescription 
> type of attribute",
>                     "searchWeight": -1
>                 },
>               {
>                     "name": "samplebigint",
>                     "typeName": "biginteger",
>                     "isOptional": true,
>                     "cardinality": "SINGLE",
>                     "valuesMinCount": 0,
>                     "valuesMaxCount": 1,
>                     "isUnique": false,
>                     "isIndexable": true,
>                     "includeInNotification": false,
>                     "description": "A sample attr for holdig BigInteger type 
> of data",
>                     "searchWeight": -1
>                 }
>               ],
>             "relationshipCategory": "COMPOSITION",
>             "relationshipLabel": "__hive_table.columns",
>             "propagateTags": "NONE",
>             "endDef1": {
>                 "type": "hive_table",
>                 "name": "columns",
>                 "isContainer": true,
>                 "cardinality": "SET",
>                 "isLegacyAttribute": true
>             },
>             "endDef2": {
>                 "type": "hive_column",
>                 "name": "table",
>                 "isContainer": false,
>                 "cardinality": "SINGLE",
>                 "isLegacyAttribute": true
>             }
>           }
>       ]
> }
> ======================================================================================================
> After this  we can create a relationship between a hive table and a hive 
> column using below mentioned API request
> Now this request provides values for BigInteger Type and the values are been 
> succesfully converted to respective types without misbehaving.
> Link used : http://localhost:21000/api/atlas/v2/relationship
> Request Type : POST
> JSON :
> {
> "end1" :
> 
> { "guid" : "4d5adf00-2c9b-4877-ad23-c41fd7319150" }
> ,
> "end2" :
>       
> { "guid" : "b0d889d1-008f-44ba-85cd-ab43abbb9a00" }
> ,
> "typeName":"hive_table_columns",
> "attributes" : {
>       "description" : "It is a very good description ",
>       "samplebigint" : 3218888888888888
>       
> }
> }
> ======================================================================================================
> 
> 
> Thanks,
> 
> mayank jain
> 
>

Reply via email to