Skip to content

Commit

Permalink
Merge pull request #98 from artem-aliev/edge-select-fix
Browse files Browse the repository at this point in the history
Fix a couple of copy-paste typos in edge selection
  • Loading branch information
lyndonbauto committed Dec 10, 2021
2 parents 4b0ae1a + f0522eb commit 1535028
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private static void appendGraphTraversal(final String table, final String column
}
} else {
// It's this vertex/edge.
if (columnName.toLowerCase(Locale.getDefault()).startsWith(gremlinTableBase.getLabel())) {
if (columnName.toLowerCase(Locale.getDefault()).startsWith(gremlinTableBase.getLabel().toLowerCase(Locale.getDefault()))) {
graphTraversal.id();
} else {
if (columnName.endsWith(IN_ID)) {
Expand All @@ -162,7 +162,7 @@ private static void appendGraphTraversal(final String table, final String column
graphTraversal.coalesce(__.outE().hasLabel(columnName.replace(OUT_ID, "")).id().fold(),
__.constant(new ArrayList<>()));
} else {
graphTraversal.coalesce(__.outV().hasLabel(columnName.replace(IN_ID, "")).id(),
graphTraversal.coalesce(__.outV().hasLabel(columnName.replace(OUT_ID, "")).id(),
__.constant(new ArrayList<>()));
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static Map<String, GremlinProperty> convert(
final GremlinProperty inFk = new GremlinProperty(inOutPair.getKey() + GremlinTableBase.IN_ID, "string");
final GremlinProperty outFk = new GremlinProperty(inOutPair.getValue() + GremlinTableBase.OUT_ID, "string");
columnsWithPKFK.put(inFk.getName(), inFk);
columnsWithPKFK.put(outFk.getName(), inFk);
columnsWithPKFK.put(outFk.getName(), outFk);
});
return columnsWithPKFK;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public void testProject() throws SQLException {
rows(r("Tom"), r("Patty"), r("Phil"), r("Susan"), r("Juanita"), r("Pavel")));
}

@Test
public void testEdges() throws SQLException {
runQueryTestResults("select * from worksFor where yearsWorked = 9", columns("person_OUT_ID", "company_IN_ID", "yearsWorked", "worksFor_ID"),
rows(r(26L, 2L, 9, 64L)));
}

@Test
public void testOrder() throws SQLException {
// ORDER with integer column.
Expand Down

0 comments on commit 1535028

Please sign in to comment.