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

(Updated Oct. 18, 2016, 2:52 a.m.)


Review request for atlas.


Changes
-------

updated to address review comments.


Bugs: ATLAS-1227
    https://issues.apache.org/jira/browse/ATLAS-1227


Repository: atlas


Description
-------

Added support for constraints in entity attributes. Following 2 constraints are 
added in this patch, which provide equivalent of isComposite and 
reverseAtributeName fields in AttributeInfo: foreignKey, mappedFromRef.

Using these constraints, hive_column.table and hive_table.columns would be 
modeled as below:

{
  "name": "hive_column",
  "attributeDefs": [
    {
      "name": "table",
      "typeName": "hive_table",
      "constraintDefs": [
        {
          "type": "foreignKey",
          "params": {
            "onDelete": "cascade"
          }
        }
      ]
    }
  ]
}

{
  "name": "hive_table",
  "attributeDefs": [
    {
      "name": "columns",
      "typeName": "array<hive_column>",
      "constraintDefs": [
        {
          "type": "mappedFromRef",
          "params": {
            "refAttribute": "table"
          }
        }
      ]
    }
  ]
}


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/model/typedef/AtlasStructDef.java 55bff2b 
  intg/src/main/java/org/apache/atlas/type/AtlasStructType.java 8813542 
  intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 264e9a8 
  intg/src/test/java/org/apache/atlas/type/TestAtlasEntityType.java 5b38e3c 
  
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java
 ea1b03b 

Diff: https://reviews.apache.org/r/52954/diff/


Testing
-------

- added unit tests
- verified that existing isComposite/reverseAttributeName fields are mapped to 
constraints correctly (when accessing entity-def via TypesREST API)


Thanks,

Madhan Neethiraj

Reply via email to