@@ -268,25 +259,16 @@ public class DSLQueriesTest extends BasicTestSetup {
...
@@ -268,25 +259,16 @@ public class DSLQueriesTest extends BasicTestSetup {
{"hive_table where (name = \"sales_fact\" and createTime >= \"2014-12-11T02:35:58.440Z\" ) select name as _col_0, createTime as _col_1 limit 10 offset 1",0},
{"hive_table where (name = \"sales_fact\" and createTime >= \"2014-12-11T02:35:58.440Z\" ) select name as _col_0, createTime as _col_1 limit 10 offset 1",0},
{"hive_table where (name = \"sales_fact\" and createTime >= \"2014-12-11T02:35:58.440Z\" ) select name as _col_0, createTime as _col_1 limit 10",1},
{"hive_table where (name = \"sales_fact\" and createTime >= \"2014-12-11T02:35:58.440Z\" ) select name as _col_0, createTime as _col_1 limit 10",1},
{"hive_table where (name = \"sales_fact\" and createTime >= \"2014-12-11T02:35:58.440Z\" ) select name as _col_0, createTime as _col_1 limit 0 offset 1",0},
{"hive_table where (name = \"sales_fact\" and createTime >= \"2014-12-11T02:35:58.440Z\" ) select name as _col_0, createTime as _col_1 limit 0 offset 1",0},
{"hive_table where name='sales_fact', db where name='Sales'",1},
{"hive_table where name='sales_fact', db where name='Sales' limit 10",1},
{"hive_table where name='sales_fact', db where name='Sales' limit 10 offset 1",0},
{"hive_table where name='sales_fact', db where name='Reporting'",0},
{"hive_table where name='sales_fact', db where name='Reporting' limit 10",0},
{"hive_table where name='sales_fact', db where name='Reporting' limit 10 offset 1",0},
{"hive_db as d where owner = ['John ETL', 'Jane BI']",2},
{"hive_db as d where owner = ['John ETL', 'Jane BI']",2},
{"hive_db as d where owner = ['John ETL', 'Jane BI'] limit 10",2},
{"hive_db as d where owner = ['John ETL', 'Jane BI'] limit 10",2},
{"hive_db as d where owner = ['John ETL', 'Jane BI'] limit 10 offset 1",1},
{"hive_db as d where owner = ['John ETL', 'Jane BI'] limit 10 offset 1",1},
verify("hive_db as d owner = ['hdfs', 'anon']","g.V().has('__typeName', 'hive_db').as('d').has('hive_db.owner', within('hdfs','anon')).limit(25).toList()");
}
}
@Test
@Test
publicvoidgroupByMin(){
publicvoidgroupByMin(){
...
@@ -222,71 +217,90 @@ public class GremlinQueryComposerTest {
...
@@ -222,71 +217,90 @@ public class GremlinQueryComposerTest {
verify("Table isa 'Dimension' and t.name = 'sales_fact'","g.V().has('__typeName', 'Table').has('__traitNames', within(''Dimension'')).limit(25).toList()");
"__.has('Table.name', eq(\"sales_fact\")),"+
"__.has('Table.name', eq(\"testtable_1\")),"+
"__.has('Table.name', eq(\"testtable_2\"))"+
").limit(25).toList()");
verify("Table where name=\"sales_fact\" and name=\"testtable_1\" and name=\"testtable_2\"",
"g.V().has('__typeName', 'Table')"+
".and("+
"__.has('Table.name', eq(\"sales_fact\")),"+
"__.has('Table.name', eq(\"testtable_1\")),"+
"__.has('Table.name', eq(\"testtable_2\"))"+
").limit(25).toList()");
verify("Table where (name=\"sales_fact\" or name=\"testtable_1\") and name=\"testtable_2\"",
"g.V().has('__typeName', 'Table')"+
".and("+
"__.or("+
"__.has('Table.name', eq(\"sales_fact\")),"+
"__.has('Table.name', eq(\"testtable_1\"))"+
"),"+
"__.has('Table.name', eq(\"testtable_2\")))"+
".limit(25).toList()");
verify("Table where name=\"sales_fact\" or (name=\"testtable_1\" and name=\"testtable_2\")",
"g.V().has('__typeName', 'Table')"+
".or("+
"__.has('Table.name', eq(\"sales_fact\")),"+
"__.and("+
"__.has('Table.name', eq(\"testtable_1\")),"+
"__.has('Table.name', eq(\"testtable_2\")))"+
")"+
".limit(25).toList()");
verify("Table where name=\"sales_fact\" or name=\"testtable_1\" and name=\"testtable_2\"",
"g.V().has('__typeName', 'Table')"+
".and("+
"__.or("+
"__.has('Table.name', eq(\"sales_fact\")),"+
"__.has('Table.name', eq(\"testtable_1\"))"+
"),"+
"__.has('Table.name', eq(\"testtable_2\")))"+
".limit(25).toList()");
verify("Table where (name=\"sales_fact\" and owner=\"Joe\") OR (name=\"sales_fact_daily_mv\" and owner=\"Joe BI\")",