atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jnhagelb...@apache.org
Subject [1/5] incubator-atlas git commit: ATLAS-1369 - Optimize gremlin queries generated by DSL translator
Date Wed, 01 Feb 2017 21:05:32 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master f640da721 -> aa74c73d0


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/aa74c73d/repository/src/test/scala/org/apache/atlas/query/GremlinTest.scala
----------------------------------------------------------------------
diff --git a/repository/src/test/scala/org/apache/atlas/query/GremlinTest.scala b/repository/src/test/scala/org/apache/atlas/query/GremlinTest.scala
index 22717ff..acc70b5 100755
--- a/repository/src/test/scala/org/apache/atlas/query/GremlinTest.scala
+++ b/repository/src/test/scala/org/apache/atlas/query/GremlinTest.scala
@@ -886,7 +886,7 @@ class GremlinTest extends BaseGremlinTest {
         .or(id("name").`=`(string("Reporting")))).field("Table").as("tab")
         .select(id("db1").field("name").as("dbName"), id("tab").field("name").as("tabName")),
g, gp
     )
-    validateJson(r, "{\n  \"query\":\"DB as db1 where (db1.createTime > 0) or (name =
\\\"Reporting\\\") Table as tab select db1.name as dbName, tab.name as tabName\",\n  \"dataType\":{\n
   \"typeName\":\"__tempQueryResultStruct6\",\n    \"attributeDefinitions\":[\n      {\n 
      \"name\":\"dbName\",\n        \"dataTypeName\":\"string\",\n        \"multiplicity\":{\n
         \"lower\":0,\n          \"upper\":1,\n          \"isUnique\":false\n        },\n
       \"isComposite\":false,\n        \"isUnique\":false,\n        \"isIndexable\":false,\n
       \"reverseAttributeName\":null\n      },\n      {\n        \"name\":\"tabName\",\n 
      \"dataTypeName\":\"string\",\n        \"multiplicity\":{\n          \"lower\":0,\n 
        \"upper\":1,\n          \"isUnique\":false\n        },\n        \"isComposite\":false,\n
       \"isUnique\":false,\n        \"isIndexable\":false,\n        \"reverseAttributeName\":null\n
     }\n    ]\n  },\n  \"rows\":[\n    {\n      \"$typeName$\":\
 "__tempQueryResultStruct6\",\n      \"dbName\":\"Sales\",\n      \"tabName\":\"sales_fact\"\n
   },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct6\",\n      \"dbName\":\"Sales\",\n
     \"tabName\":\"product_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct6\",\n
     \"dbName\":\"Sales\",\n      \"tabName\":\"time_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct6\",\n
     \"dbName\":\"Sales\",\n      \"tabName\":\"customer_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct6\",\n
     \"dbName\":\"Reporting\",\n      \"tabName\":\"sales_fact_daily_mv\"\n    },\n    {\n
     \"$typeName$\":\"__tempQueryResultStruct6\",\n      \"dbName\":\"Reporting\",\n     
\"tabName\":\"sales_fact_monthly_mv\"\n    }\n  ]\n}")
+    validateJson(r, "{\n  \"query\":\"DB as db1 where (createTime > 0) or (name = \\\"Reporting\\\")
Table as tab select db1.name as dbName, tab.name as tabName\",\n  \"dataType\":{\n    \"typeName\":\"__tempQueryResultStruct6\",\n
   \"attributeDefinitions\":[\n      {\n        \"name\":\"dbName\",\n        \"dataTypeName\":\"string\",\n
       \"multiplicity\":{\n          \"lower\":0,\n          \"upper\":1,\n          \"isUnique\":false\n
       },\n        \"isComposite\":false,\n        \"isUnique\":false,\n        \"isIndexable\":false,\n
       \"reverseAttributeName\":null\n      },\n      {\n        \"name\":\"tabName\",\n 
      \"dataTypeName\":\"string\",\n        \"multiplicity\":{\n          \"lower\":0,\n 
        \"upper\":1,\n          \"isUnique\":false\n        },\n        \"isComposite\":false,\n
       \"isUnique\":false,\n        \"isIndexable\":false,\n        \"reverseAttributeName\":null\n
     }\n    ]\n  },\n  \"rows\":[\n    {\n      \"$typeName$\":\"__t
 empQueryResultStruct6\",\n      \"dbName\":\"Sales\",\n      \"tabName\":\"sales_fact\"\n
   },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct6\",\n      \"dbName\":\"Sales\",\n
     \"tabName\":\"product_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct6\",\n
     \"dbName\":\"Sales\",\n      \"tabName\":\"time_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct6\",\n
     \"dbName\":\"Sales\",\n      \"tabName\":\"customer_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct6\",\n
     \"dbName\":\"Reporting\",\n      \"tabName\":\"sales_fact_daily_mv\"\n    },\n    {\n
     \"$typeName$\":\"__tempQueryResultStruct6\",\n      \"dbName\":\"Reporting\",\n     
\"tabName\":\"sales_fact_monthly_mv\"\n    }\n  ]\n}")
   }
 
   @Test def testJoinAndSelect3 {
@@ -896,7 +896,7 @@ class GremlinTest extends BaseGremlinTest {
         .or(id("db1").hasField("owner"))).field("Table").as("tab")
         .select(id("db1").field("name").as("dbName"), id("tab").field("name").as("tabName")),
g, gp
     )
-    validateJson(r, "{\n  \"query\":\"DB as db1 where (db1.createTime > 0) and (db1.name
= \\\"Reporting\\\") or db1 has owner Table as tab select db1.name as dbName, tab.name as
tabName\",\n  \"dataType\":{\n    \"typeName\":\"__tempQueryResultStruct7\",\n    \"attributeDefinitions\":[\n
     {\n        \"name\":\"dbName\",\n        \"dataTypeName\":\"string\",\n        \"multiplicity\":{\n
         \"lower\":0,\n          \"upper\":1,\n          \"isUnique\":false\n        },\n
       \"isComposite\":false,\n        \"isUnique\":false,\n        \"isIndexable\":false,\n
       \"reverseAttributeName\":null\n      },\n      {\n        \"name\":\"tabName\",\n 
      \"dataTypeName\":\"string\",\n        \"multiplicity\":{\n          \"lower\":0,\n 
        \"upper\":1,\n          \"isUnique\":false\n        },\n        \"isComposite\":false,\n
       \"isUnique\":false,\n        \"isIndexable\":false,\n        \"reverseAttributeName\":null\n
     }\n    ]\n  },\n  \"rows\":[\n    {\n
       \"$typeName$\":\"__tempQueryResultStruct7\",\n      \"dbName\":\"Sales\",\n      \"tabName\":\"sales_fact\"\n
   },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct7\",\n      \"dbName\":\"Sales\",\n
     \"tabName\":\"product_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct7\",\n
     \"dbName\":\"Sales\",\n      \"tabName\":\"time_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct7\",\n
     \"dbName\":\"Sales\",\n      \"tabName\":\"customer_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct7\",\n
     \"dbName\":\"Reporting\",\n      \"tabName\":\"sales_fact_daily_mv\"\n    },\n    {\n
     \"$typeName$\":\"__tempQueryResultStruct7\",\n      \"dbName\":\"Reporting\",\n     
\"tabName\":\"sales_fact_monthly_mv\"\n    }\n  ]\n}")
+    validateJson(r, "{\n  \"query\":\"DB as db1 where (createTime > 0) and (name = \\\"Reporting\\\")
or db1 has owner Table as tab select db1.name as dbName, tab.name as tabName\",\n  \"dataType\":{\n
   \"typeName\":\"__tempQueryResultStruct7\",\n    \"attributeDefinitions\":[\n      {\n 
      \"name\":\"dbName\",\n        \"dataTypeName\":\"string\",\n        \"multiplicity\":{\n
         \"lower\":0,\n          \"upper\":1,\n          \"isUnique\":false\n        },\n
       \"isComposite\":false,\n        \"isUnique\":false,\n        \"isIndexable\":false,\n
       \"reverseAttributeName\":null\n      },\n      {\n        \"name\":\"tabName\",\n 
      \"dataTypeName\":\"string\",\n        \"multiplicity\":{\n          \"lower\":0,\n 
        \"upper\":1,\n          \"isUnique\":false\n        },\n        \"isComposite\":false,\n
       \"isUnique\":false,\n        \"isIndexable\":false,\n        \"reverseAttributeName\":null\n
     }\n    ]\n  },\n  \"rows\":[\n    {\n      \"
 $typeName$\":\"__tempQueryResultStruct7\",\n      \"dbName\":\"Sales\",\n      \"tabName\":\"sales_fact\"\n
   },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct7\",\n      \"dbName\":\"Sales\",\n
     \"tabName\":\"product_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct7\",\n
     \"dbName\":\"Sales\",\n      \"tabName\":\"time_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct7\",\n
     \"dbName\":\"Sales\",\n      \"tabName\":\"customer_dim\"\n    },\n    {\n      \"$typeName$\":\"__tempQueryResultStruct7\",\n
     \"dbName\":\"Reporting\",\n      \"tabName\":\"sales_fact_daily_mv\"\n    },\n    {\n
     \"$typeName$\":\"__tempQueryResultStruct7\",\n      \"dbName\":\"Reporting\",\n     
\"tabName\":\"sales_fact_monthly_mv\"\n    }\n  ]\n}")
   }
 
   @Test def testJoinAndSelect4 {


Mime
View raw message