Closed Easy65 closed 6 years ago
There is already a test testEmptyWithin in class TestGremlinCompileWhere. I added this and this reproduces the problem:
@Test
public void testEmptyWithout() throws InterruptedException {
this.sqlgGraph.addVertex(T.label, "Person", "age", 1);
this.sqlgGraph.addVertex(T.label, "Person", "age", 2);
this.sqlgGraph.addVertex(T.label, "Person", "age", 3);
this.sqlgGraph.tx().commit();
testEmptyWithout_assert(this.sqlgGraph);
if (this.sqlgGraph1 != null) {
Thread.sleep(SLEEP_TIME);
testEmptyWithin_assert(this.sqlgGraph1);
}
}
private void testEmptyWithout_assert(SqlgGraph sqlgGraph) {
DefaultGraphTraversal<Vertex, Vertex> traversal = (DefaultGraphTraversal<Vertex, Vertex>) sqlgGraph.traversal()
.V().hasLabel("Person").has("age", P.without(Collections.emptyList()));
Assert.assertEquals(2, traversal.getSteps().size());
List<Vertex> vertices = traversal.toList();
Assert.assertEquals(1, traversal.getSteps().size());
Assert.assertEquals(3, vertices.size());
}
resulting in this stacktrace:
java.lang.RuntimeException: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")" Position: 156 at org.umlg.sqlg.strategy.SqlgSqlExecutor.executeQuery(SqlgSqlExecutor.java:146) at org.umlg.sqlg.strategy.SqlgSqlExecutor.executeRegularQuery(SqlgSqlExecutor.java:77) at org.umlg.sqlg.structure.SqlgCompiledResultIterator.executeRegularQuery(SqlgCompiledResultIterator.java:249) at org.umlg.sqlg.structure.SqlgCompiledResultIterator.hasNextLazy(SqlgCompiledResultIterator.java:121) at org.umlg.sqlg.structure.SqlgCompiledResultIterator.hasNext(SqlgCompiledResultIterator.java:78) at org.umlg.sqlg.step.SqlgGraphStep.processNextStart(SqlgGraphStep.java:77) at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:128) at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:38) at org.apache.tinkerpop.gremlin.process.traversal.Traversal.fill(Traversal.java:179) at org.apache.tinkerpop.gremlin.process.traversal.Traversal.toList(Traversal.java:117) at org.umlg.sqlg.preparedstatement.TestGremlinCompileWhere.testEmptyWithout_assert(TestGremlinCompileWhere.java:562) at org.umlg.sqlg.preparedstatement.TestGremlinCompileWhere.testEmptyWithout(TestGremlinCompileWhere.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")" Position: 156 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155) at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:353) at org.umlg.sqlg.strategy.SqlgSqlExecutor.executeQuery(SqlgSqlExecutor.java:142) ... 39 more
Hi,
I tried a gremlin query with has("mode", P.without(collection)). Should it work also with an empty collection? (Would be easier to use if it would.)
I get a org.postgresql.util.PSQLException: ERROR: syntax error at or near ")" which seems to come from this WHERE clause:
Regards, Andreas