verify("hive_db as d owner = ['hdfs', 'anon']","g.V().has('__typeName', 'hive_db').as('d').has('hive_db.owner', within('hdfs','anon')).limit(local, 25).limit(25).toList()");
verify("DB where owner = ['hdfs', 'anon']","g.V().has('__typeName', 'DB').has('DB.owner', within('hdfs','anon')).dedup().limit(25).toList()");
verify("hive_db as d owner = ['hdfs', 'anon']","g.V().has('__typeName', 'hive_db').as('d').has('hive_db.owner', within('hdfs','anon')).dedup().limit(25).toList()");
}
@Test
publicvoidgroupByMin(){
verify("from DB groupby (owner) select min(name) orderby name limit 2",
verify("Table as t where t.createTime = \"2017-12-12T02:35:58.440Z\" select t.name, t.owner",getExpected(exSel,String.format(exMain,"1513046158440")));
verify("Table as t where t.createTime = \"2017-12-12\" select t.name, t.owner",getExpected(exSel,String.format(exMain,"1513036800000")));
verify("Table isa 'Dimension' and name = 'sales_fact'","g.V().has('__typeName', 'Table').and(__.has('__traitNames', within('Dimension')),__.has('Table.name', eq('sales_fact'))).limit(local, 25).limit(25).toList()");
verify("Table has name and name = 'sales_fact'","g.V().has('__typeName', 'Table').and(__.has('Table.name'),__.has('Table.name', eq('sales_fact'))).limit(local, 25).limit(25).toList()");
verify("Table is 'Dimension' and Table has owner and name = 'sales_fact'","g.V().has('__typeName', 'Table').and(__.has('__traitNames', within('Dimension')),__.has('Table.owner'),__.has('Table.name', eq('sales_fact'))).limit(local, 25).limit(25).toList()");
verify("Table has name and Table has owner and name = 'sales_fact'","g.V().has('__typeName', 'Table').and(__.has('Table.name'),__.has('Table.owner'),__.has('Table.name', eq('sales_fact'))).limit(local, 25).limit(25).toList()");
verify("Table isa 'Dimension' and name = 'sales_fact'","g.V().has('__typeName', 'Table').and(__.has('__traitNames', within('Dimension')),__.has('Table.name', eq('sales_fact'))).dedup().limit(25).toList()");
verify("Table has name and name = 'sales_fact'","g.V().has('__typeName', 'Table').and(__.has('Table.name'),__.has('Table.name', eq('sales_fact'))).dedup().limit(25).toList()");
verify("Table is 'Dimension' and Table has owner and name = 'sales_fact'","g.V().has('__typeName', 'Table').and(__.has('__traitNames', within('Dimension')),__.has('Table.owner'),__.has('Table.name', eq('sales_fact'))).dedup().limit(25).toList()");
verify("Table has name and Table has owner and name = 'sales_fact'","g.V().has('__typeName', 'Table').and(__.has('Table.name'),__.has('Table.owner'),__.has('Table.name', eq('sales_fact'))).dedup().limit(25).toList()");
}
@Test
publicvoidnumericAttributes(){
verify("Table where partitionSize = 2048","g.V().has('__typeName', 'Table').has('Table.partitionSize', eq(2048)).limit(local, 25).limit(25).toList()");
verify("Table where partitionSize = 2048 or partitionSize = 10","g.V().has('__typeName', 'Table').or(__.has('Table.partitionSize', eq(2048)),__.has('Table.partitionSize', eq(10))).limit(local, 25).limit(25).toList()");
verify("Table where partitionSize = 2048","g.V().has('__typeName', 'Table').has('Table.partitionSize', eq(2048)).dedup().limit(25).toList()");
verify("Table where partitionSize = 2048 or partitionSize = 10","g.V().has('__typeName', 'Table').or(__.has('Table.partitionSize', eq(2048)),__.has('Table.partitionSize', eq(10))).dedup().limit(25).toList()");
}
@Test
publicvoidsystemAttributes(){
verify("Table has __state","g.V().has('__typeName', 'Table').has('__state').limit(local, 25).limit(25).toList()");
verify("Table as t where t.__state = 'ACTIVE'","g.V().has('__typeName', 'Table').as('t').has('__state', eq('ACTIVE')).limit(local, 25).limit(25).toList()");
verify("Table has __state","g.V().has('__typeName', 'Table').has('__state').dedup().limit(25).toList()");