Commit 1616b3f9 by Madhan Neethiraj

ATLAS-2714: model updates - added relationship-def…

ATLAS-2714: model updates - added relationship-def _AtlasUserProfile_savedsearches, updated few relationships to align end1/end2 with edge-direction, fixed cardinality of array attributes from SINGLE to LIST/SET
parent 2bb7f778
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
{ {
"name": "inputs", "name": "inputs",
"typeName": "array<DataSet>", "typeName": "array<DataSet>",
"cardinality": "SINGLE", "cardinality": "SET",
"isIndexable": false, "isIndexable": false,
"isOptional": true, "isOptional": true,
"isUnique": false "isUnique": false
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
{ {
"name": "outputs", "name": "outputs",
"typeName": "array<DataSet>", "typeName": "array<DataSet>",
"cardinality": "SINGLE", "cardinality": "SET",
"isIndexable": false, "isIndexable": false,
"isOptional": true, "isOptional": true,
"isUnique": false "isUnique": false
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
{ {
"name": "savedSearches", "name": "savedSearches",
"typeName": "array<__AtlasUserSavedSearch>", "typeName": "array<__AtlasUserSavedSearch>",
"cardinality": "LIST", "cardinality": "SET",
"isIndexable": false, "isIndexable": false,
"isOptional": true, "isOptional": true,
"isUnique": false, "isUnique": false,
...@@ -201,19 +201,19 @@ ...@@ -201,19 +201,19 @@
"typeVersion": "1.0", "typeVersion": "1.0",
"relationshipCategory": "AGGREGATION", "relationshipCategory": "AGGREGATION",
"endDef1": { "endDef1": {
"type": "DataSet",
"name": "inputToProcesses",
"isContainer": false,
"cardinality": "SET"
},
"endDef2": {
"type": "Process", "type": "Process",
"name": "inputs", "name": "inputs",
"isContainer": true, "isContainer": true,
"cardinality": "SET", "cardinality": "SET",
"isLegacyAttribute": true "isLegacyAttribute": true
}, },
"propagateTags": "ONE_TO_TWO" "endDef2": {
"type": "DataSet",
"name": "inputToProcesses",
"isContainer": false,
"cardinality": "SET"
},
"propagateTags": "TWO_TO_ONE"
}, },
{ {
"name": "process_dataset_outputs", "name": "process_dataset_outputs",
...@@ -233,6 +233,25 @@ ...@@ -233,6 +233,25 @@
"cardinality": "SET" "cardinality": "SET"
}, },
"propagateTags": "ONE_TO_TWO" "propagateTags": "ONE_TO_TWO"
},
{
"name": "__AtlasUserProfile_savedsearches",
"typeVersion": "1.0",
"relationshipCategory": "COMPOSITION",
"endDef1": {
"type": "__AtlasUserProfile",
"name": "savedSearches",
"isContainer": true,
"cardinality": "SET",
"isLegacyAttribute": true
},
"endDef2": {
"type": "__AtlasUserSavedSearch",
"name": "userProfile",
"isContainer": false,
"cardinality": "SINGLE"
},
"propagateTags": "NONE"
} }
] ]
} }
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
{ {
"name": "recentQueries", "name": "recentQueries",
"typeName": "array<string>", "typeName": "array<string>",
"cardinality": "SINGLE", "cardinality": "LIST",
"isIndexable": false, "isIndexable": false,
"isOptional": true, "isOptional": true,
"isUnique": false "isUnique": false
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
{ {
"name": "partitionKeys", "name": "partitionKeys",
"typeName": "array<hive_column>", "typeName": "array<hive_column>",
"cardinality": "SINGLE", "cardinality": "SET",
"constraints": [ "constraints": [
{ {
"type": "ownedRef" "type": "ownedRef"
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
{ {
"name": "aliases", "name": "aliases",
"typeName": "array<string>", "typeName": "array<string>",
"cardinality": "SINGLE", "cardinality": "SET",
"isIndexable": false, "isIndexable": false,
"isOptional": true, "isOptional": true,
"isUnique": false "isUnique": false
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
{ {
"name": "columns", "name": "columns",
"typeName": "array<hive_column>", "typeName": "array<hive_column>",
"cardinality": "SINGLE", "cardinality": "SET",
"constraints": [ "constraints": [
{ {
"type": "ownedRef" "type": "ownedRef"
...@@ -375,7 +375,7 @@ ...@@ -375,7 +375,7 @@
{ {
"name": "bucketCols", "name": "bucketCols",
"typeName": "array<string>", "typeName": "array<string>",
"cardinality": "SINGLE", "cardinality": "SET",
"isIndexable": false, "isIndexable": false,
"isOptional": true, "isOptional": true,
"isUnique": false "isUnique": false
...@@ -383,7 +383,7 @@ ...@@ -383,7 +383,7 @@
{ {
"name": "sortCols", "name": "sortCols",
"typeName": "array<hive_order>", "typeName": "array<hive_order>",
"cardinality": "SINGLE", "cardinality": "SET",
"isIndexable": false, "isIndexable": false,
"isOptional": true, "isOptional": true,
"isUnique": false "isUnique": false
...@@ -525,22 +525,22 @@ ...@@ -525,22 +525,22 @@
], ],
"relationshipDefs": [ "relationshipDefs": [
{ {
"name": "hive_db_tables", "name": "hive_table_db",
"typeVersion": "1.0", "typeVersion": "1.0",
"relationshipCategory": "COMPOSITION", "relationshipCategory": "COMPOSITION",
"endDef1": { "endDef1": {
"type": "hive_db",
"name": "tables",
"isContainer": true,
"cardinality": "SET"
},
"endDef2": {
"type": "hive_table", "type": "hive_table",
"name": "db", "name": "db",
"isContainer": false, "isContainer": false,
"cardinality": "SINGLE", "cardinality": "SINGLE",
"isLegacyAttribute": true "isLegacyAttribute": true
}, },
"endDef2": {
"type": "hive_db",
"name": "tables",
"isContainer": true,
"cardinality": "SET"
},
"propagateTags": "NONE" "propagateTags": "NONE"
}, },
{ {
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
{ {
"name": "column_families", "name": "column_families",
"typeName": "array<hbase_column_family>", "typeName": "array<hbase_column_family>",
"cardinality": "SINGLE", "cardinality": "SET",
"constraints": [ "constraints": [
{ {
"type": "ownedRef" "type": "ownedRef"
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
{ {
"name": "columns", "name": "columns",
"typeName": "array<hbase_column>", "typeName": "array<hbase_column>",
"cardinality": "SINGLE", "cardinality": "SET",
"constraints": [ "constraints": [
{ {
"type": "ownedRef" "type": "ownedRef"
...@@ -149,22 +149,22 @@ ...@@ -149,22 +149,22 @@
], ],
"relationshipDefs": [ "relationshipDefs": [
{ {
"name": "hbase_namespace_tables", "name": "hbase_table_namespace",
"typeVersion": "1.0", "typeVersion": "1.0",
"relationshipCategory": "COMPOSITION", "relationshipCategory": "COMPOSITION",
"endDef1": { "endDef1": {
"type": "hbase_namespace",
"name": "tables",
"isContainer": true,
"cardinality": "SET"
},
"endDef2": {
"type": "hbase_table", "type": "hbase_table",
"name": "namespace", "name": "namespace",
"isContainer": false, "isContainer": false,
"cardinality": "SINGLE", "cardinality": "SINGLE",
"isLegacyAttribute": true "isLegacyAttribute": true
}, },
"endDef2": {
"type": "hbase_namespace",
"name": "tables",
"isContainer": true,
"cardinality": "SET"
},
"propagateTags": "NONE" "propagateTags": "NONE"
}, },
{ {
......
...@@ -42,7 +42,7 @@ public class ComplexAttributesTest extends MigrationBaseAsserts { ...@@ -42,7 +42,7 @@ public class ComplexAttributesTest extends MigrationBaseAsserts {
String ENTITY_TYPE = "entity_type"; String ENTITY_TYPE = "entity_type";
String ENTITY_WITH_COMPLEX_COLL_TYPE = "entity_with_complex_collection_attr"; String ENTITY_WITH_COMPLEX_COLL_TYPE = "entity_with_complex_collection_attr";
final int EXPECTED_TOTAL_COUNT = 214; final int EXPECTED_TOTAL_COUNT = 215;
final int EXPECTED_ENTITY_TYPE_COUNT = 16; final int EXPECTED_ENTITY_TYPE_COUNT = 16;
final int EXPECTED_STRUCT_TYPE_COUNT = 3; final int EXPECTED_STRUCT_TYPE_COUNT = 3;
final int EXPECTED_ENTITY_WITH_COMPLEX_COLL_TYPE_COUNT = 1; final int EXPECTED_ENTITY_WITH_COMPLEX_COLL_TYPE_COUNT = 1;
......
...@@ -39,7 +39,7 @@ public class HiveParititionTest extends MigrationBaseAsserts { ...@@ -39,7 +39,7 @@ public class HiveParititionTest extends MigrationBaseAsserts {
@Test @Test
public void fileImporterTest() throws IOException, AtlasBaseException { public void fileImporterTest() throws IOException, AtlasBaseException {
final int EXPECTED_TOTAL_COUNT = 141; final int EXPECTED_TOTAL_COUNT = 142;
final int EXPECTED_DB_COUNT = 1; final int EXPECTED_DB_COUNT = 1;
final int EXPECTED_TABLE_COUNT = 2; final int EXPECTED_TABLE_COUNT = 2;
final int EXPECTED_COLUMN_COUNT = 7; final int EXPECTED_COLUMN_COUNT = 7;
...@@ -51,8 +51,8 @@ public class HiveParititionTest extends MigrationBaseAsserts { ...@@ -51,8 +51,8 @@ public class HiveParititionTest extends MigrationBaseAsserts {
assertTypeCountNameGuid("hive_db", 1, "parts_db", "ae30d78b-51b4-42ab-9436-8d60c8f68b95"); assertTypeCountNameGuid("hive_db", 1, "parts_db", "ae30d78b-51b4-42ab-9436-8d60c8f68b95");
assertTypeCountNameGuid("hive_process", 1, "", ""); assertTypeCountNameGuid("hive_process", 1, "", "");
assertEdges("hive_db", "parts_db", AtlasEdgeDirection.IN,1, 1, ""); assertEdges("hive_db", "parts_db", AtlasEdgeDirection.IN,1, 1, "");
assertEdges("hive_table", "t1", AtlasEdgeDirection.OUT, 1, 1, "hive_db_tables"); assertEdges("hive_table", "t1", AtlasEdgeDirection.OUT, 1, 1, "hive_table_db");
assertEdges("hive_table", "tv1", AtlasEdgeDirection.OUT, 1, 1, "hive_db_tables"); assertEdges("hive_table", "tv1", AtlasEdgeDirection.OUT, 1, 1, "hive_table_db");
assertMigrationStatus(EXPECTED_TOTAL_COUNT); assertMigrationStatus(EXPECTED_TOTAL_COUNT);
} }
......
...@@ -37,7 +37,7 @@ public class HiveStocksTest extends MigrationBaseAsserts { ...@@ -37,7 +37,7 @@ public class HiveStocksTest extends MigrationBaseAsserts {
@Test @Test
public void migrateStocks() throws AtlasBaseException, IOException { public void migrateStocks() throws AtlasBaseException, IOException {
final int EXPECTED_TOTAL_COUNT = 188; final int EXPECTED_TOTAL_COUNT = 189;
final int EXPECTED_DB_COUNT = 1; final int EXPECTED_DB_COUNT = 1;
final int EXPECTED_TABLE_COUNT = 1; final int EXPECTED_TABLE_COUNT = 1;
final int EXPECTED_COLUMN_COUNT = 7; final int EXPECTED_COLUMN_COUNT = 7;
...@@ -59,7 +59,7 @@ public class HiveStocksTest extends MigrationBaseAsserts { ...@@ -59,7 +59,7 @@ public class HiveStocksTest extends MigrationBaseAsserts {
assertTypeCountNameGuid("Tag1", 1, "", ""); assertTypeCountNameGuid("Tag1", 1, "", "");
assertEdges(getVertex("hive_db", "stocks").getEdges(AtlasEdgeDirection.IN).iterator(),1, 1, ""); assertEdges(getVertex("hive_db", "stocks").getEdges(AtlasEdgeDirection.IN).iterator(),1, 1, "");
assertEdges(getVertex("hive_table", "stocks_daily").getEdges(AtlasEdgeDirection.OUT).iterator(), 1, 1, "hive_db_tables"); assertEdges(getVertex("hive_table", "stocks_daily").getEdges(AtlasEdgeDirection.OUT).iterator(), 1, 1, "hive_table_db");
assertEdges(getVertex("hive_column", "high").getEdges(AtlasEdgeDirection.OUT).iterator(), 1,1, "hive_table_columns"); assertEdges(getVertex("hive_column", "high").getEdges(AtlasEdgeDirection.OUT).iterator(), 1,1, "hive_table_columns");
assertMigrationStatus(EXPECTED_TOTAL_COUNT); assertMigrationStatus(EXPECTED_TOTAL_COUNT);
......
...@@ -44,7 +44,7 @@ public class PathTest extends MigrationBaseAsserts { ...@@ -44,7 +44,7 @@ public class PathTest extends MigrationBaseAsserts {
@Test @Test
public void migrationImport() throws IOException, AtlasBaseException { public void migrationImport() throws IOException, AtlasBaseException {
final int EXPECTED_TOTAL_COUNT = 89; final int EXPECTED_TOTAL_COUNT = 90;
runFileImporter("path_db"); runFileImporter("path_db");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment