Skip to content

Commit

Permalink
[GIE Compiler] minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shirly121 committed Sep 27, 2023
1 parent f80c160 commit 87ee2ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ public void with_12_test() {
RelNode project =
Utils.eval("Match (a:person)-[]-(b:person) Return [a.name, b.age, 1]").build();
Assert.assertEquals(
"GraphLogicalProject($f0=[ARRAY_VALUE_CONSTRUCTOR(a.name, b.age, 1)],"
+ " isAppend=[false])\n"
"GraphLogicalProject($f0=[ARRAY(a.name, b.age, 1)], isAppend=[false])\n"
+ " GraphLogicalSingleMatch(input=[null],"
+ " sentence=[GraphLogicalGetV(tableConfig=[{isAll=false, tables=[person]}],"
+ " alias=[b], opt=[OTHER])\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void g_V_has_name_eq_marko_test() {

@Test
public void g_V_has_name_neq_marko_test() {
RelNode node = eval("g.V().has('name', eq('marko'))");
RelNode node = eval("g.V().has('name', neq('marko'))");
Assert.assertEquals(
"GraphLogicalSource(tableConfig=[{isAll=true, tables=[software, person]}],"
+ " alias=[DEFAULT], fusedFilter=[[<>(DEFAULT.name, _UTF-8'marko')]],"
Expand All @@ -152,6 +152,16 @@ public void g_V_has_age_gt_17_test() {
node.explain().trim());
}

// hasNot('age') -> age is null
@Test
public void g_V_hasNot_age_test() {
RelNode node = eval("g.V().hasNot('age')");
Assert.assertEquals(
"GraphLogicalSource(tableConfig=[{isAll=true, tables=[software, person]}],"
+ " alias=[DEFAULT], fusedFilter=[[IS NULL(DEFAULT.age)]], opt=[VERTEX])",
node.explain().trim());
}

// todo: convert SEARCH operator to ir core structure
@Test
public void g_V_has_age_inside_17_20_test() {
Expand All @@ -178,8 +188,8 @@ public void g_V_has_age_within_test() {
RelNode node = eval("g.V().has('age', within(17, 20))");
Assert.assertEquals(
"GraphLogicalSource(tableConfig=[{isAll=true, tables=[software, person]}],"
+ " alias=[DEFAULT], fusedFilter=[[SEARCH(DEFAULT.age, Sarg[17, 20])]],"
+ " opt=[VERTEX])",
+ " alias=[DEFAULT], fusedFilter=[[SEARCH(DEFAULT.age, Sarg[17, 20])]],"
+ " opt=[VERTEX])",
node.explain().trim());
}

Expand Down

0 comments on commit 87ee2ea

Please sign in to comment.