javeme commented on code in PR #538:
URL:
https://github.com/apache/incubator-hugegraph-toolchain/pull/538#discussion_r1409295952
##########
hugegraph-client/src/main/java/org/apache/hugegraph/driver/HugeClient.java:
##########
@@ -61,7 +61,7 @@ public HugeClient(HugeClientBuilder builder) {
builder.trustStoreFile(),
builder.trustStorePassword());
} catch (Exception e) {
- log.error("", e);
+ log.warn("create RestClient instance error", e);
Review Comment:
please use `private static final Logger LOG =
LoggerFactory.getLogger(RestClient.class);`
##########
hugegraph-client/src/main/java/org/apache/hugegraph/driver/HugeClient.java:
##########
@@ -61,7 +61,7 @@ public HugeClient(HugeClientBuilder builder) {
builder.trustStoreFile(),
builder.trustStorePassword());
} catch (Exception e) {
- log.error("", e);
+ log.warn("create RestClient instance error", e);
Review Comment:
prefer `Failed to create RestClient instance`
##########
hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeTest.java:
##########
@@ -662,25 +662,46 @@ public void
testGetEdgesByLabelAndPropertiesWithRangeCondition()
}
}
+ @Test
+ public void testSpecialCharacter() {
+ schema().indexLabel("createdByCity").secondary()
+ .onE("created").by("city").create();
+ schema().indexLabel("createdByDate").secondary()
+ .onE("created").by("date @&$=*?").create();
+
+ Object markoId = getVertexId("person", "name", "marko");
+ Object lopId = getVertexId("software", "name", "lop");
+ Object rippleId = getVertexId("software", "name", "ripple");
+ graph().addEdge(markoId, "created", lopId,
+ "date", "2014-01-10", "city", "Shanghai", "date
@&$=*?", "2014-01-10");
+ graph().addEdge(markoId, "created", rippleId,
+ "date", "2015-01-10", "city", "Shanghai @&$=*?");
+
+ Map<String, Object> properties = ImmutableMap.of(
+ "date @&$=*?", "P.eq(\"2014-1-10\")");
+ List<Edge> edges = graph().listEdges("created", properties, false);
+ Assert.assertEquals(1, edges.size());
+
+ Map<String, Object> properties2 = ImmutableMap.of("city", "Shanghai");
+ edges = graph().listEdges("created", properties2, true);
+ Assert.assertEquals(1, edges.size());
+
+ Map<String, Object> properties3 = ImmutableMap.of("city", "Shanghai
@&$=*?");
+ edges = graph().listEdges("created", properties3, true);
+ Assert.assertEquals(1, edges.size());
+
Review Comment:
unused blank line
##########
hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeTest.java:
##########
@@ -662,25 +662,46 @@ public void
testGetEdgesByLabelAndPropertiesWithRangeCondition()
}
}
+ @Test
+ public void testSpecialCharacter() {
Review Comment:
testGetEdgesWithSpecialChars
##########
hugegraph-client/src/test/java/org/apache/hugegraph/functional/EdgeTest.java:
##########
@@ -662,25 +662,46 @@ public void
testGetEdgesByLabelAndPropertiesWithRangeCondition()
}
}
+ @Test
+ public void testSpecialCharacter() {
+ schema().indexLabel("createdByCity").secondary()
+ .onE("created").by("city").create();
+ schema().indexLabel("createdByDate").secondary()
+ .onE("created").by("date @&$=*?").create();
+
+ Object markoId = getVertexId("person", "name", "marko");
+ Object lopId = getVertexId("software", "name", "lop");
+ Object rippleId = getVertexId("software", "name", "ripple");
+ graph().addEdge(markoId, "created", lopId,
+ "date", "2014-01-10", "city", "Shanghai", "date
@&$=*?", "2014-01-10");
+ graph().addEdge(markoId, "created", rippleId,
+ "date", "2015-01-10", "city", "Shanghai @&$=*?");
+
+ Map<String, Object> properties = ImmutableMap.of(
+ "date @&$=*?", "P.eq(\"2014-1-10\")");
Review Comment:
keep in one line?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]