atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Madhan Neethiraj <mad...@apache.org>
Subject Review Request 52954: ATLAS-1227: added support for attribute constraints in the model
Date Mon, 17 Oct 2016 19:24:28 GMT

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

Review request for atlas.


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
-----

  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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message