apache / incubator-hugegraph

A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends)
https://hugegraph.apache.org
Apache License 2.0
2.66k stars 520 forks source link

[Bug] 使用path的gremlin语句查询时报错 #1814

Open zhouliweb opened 2 years ago

zhouliweb commented 2 years ago

Bug Type (问题类型)

other exception / error (其他异常报错)

Before submit

Environment (环境信息)

Expected & Actual behavior (期望与实际表现)

如下语句,使用在gremlinpython中提交查询时,会出现报错:

g.V().has('bid', within(25235, 25237, 25253, 25254)).out('brandKeyword').path().by(valueMap()).toList()


could not be serialized by org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV2d0.
org.apache.tinkerpop.shaded.jackson.databind.exc.InvalidDefinitionException: Type id handling not implemented for type org.apache.tinkerpop.gremlin.process.traversal.Path (by serializer of type com.baidu.hugegraph.io.HugeGraphSONModule$PathSerializer)
        at org.apache.tinkerpop.shaded.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1191) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:313) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.JsonSerializer.serializeWithType(JsonSerializer.java:160) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.impl.TypeWrappedSerializer.serialize(TypeWrappedSerializer.java:32) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:2656) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:381) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.core.JsonGenerator.writeObjectField(JsonGenerator.java:1726) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.structure.io.graphson.TraversalSerializersV3d0$TraverserJacksonSerializer.serialize(TraversalSerializersV3d0.java:237) ~[gremlin-core-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.structure.io.graphson.TraversalSerializersV3d0$TraverserJacksonSerializer.serialize(TraversalSerializersV3d0.java:226) ~[gremlin-core-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer.serializeWithType(StdScalarSerializer.java:46) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.impl.TypeWrappedSerializer.serialize(TypeWrappedSerializer.java:32) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:2656) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:381) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.structure.io.graphson.JavaUtilSerializersV3d0$ListJacksonSerializer.serialize(JavaUtilSerializersV3d0.java:127) ~[gremlin-core-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.structure.io.graphson.JavaUtilSerializersV3d0$ListJacksonSerializer.serializeWithType(JavaUtilSerializersV3d0.java:135) ~[gremlin-core-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.structure.io.graphson.JavaUtilSerializersV3d0$ListJacksonSerializer.serializeWithType(JavaUtilSerializersV3d0.java:118) ~[gremlin-core-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.impl.TypeWrappedSerializer.serialize(TypeWrappedSerializer.java:32) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV2d0$ResponseMessageSerializer.ser(AbstractGraphSONMessageSerializerV2d0.java:277) ~[gremlin-driver-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV2d0$ResponseMessageSerializer.serializeWithType(AbstractGraphSONMessageSerializerV2d0.java:251) ~[gremlin-driver-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV2d0$ResponseMessageSerializer.serializeWithType(AbstractGraphSONMessageSerializerV2d0.java:236) ~[gremlin-driver-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.impl.TypeWrappedSerializer.serialize(TypeWrappedSerializer.java:32) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3906) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper.writeValueAsBytes(ObjectMapper.java:3244) ~[gremlin-shaded-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV2d0.serializeResponseAsBinary(AbstractGraphSONMessageSerializerV2d0.java:86) ~[gremlin-driver-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.server.op.AbstractOpProcessor.makeFrame(AbstractOpProcessor.java:329) ~[gremlin-server-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.handleIterator(TraversalOpProcessor.java:564) ~[gremlin-server-3.4.3.jar:3.4.3]
        at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.lambda$iterateBytecodeTraversal$4(TraversalOpProcessor.java:401) ~[gremlin-server-3.4.3.jar:3.4.3]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_171]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_171]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_171]
        at com.baidu.hugegraph.auth.HugeGraphAuthProxy$ContextTask.run(HugeGraphAuthProxy.java:1748) [hugegraph-api-0.12.0.jar:0.67.0.0]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_171]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_171]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]

### Vertex/Edge example (问题点 / 边数据举例)

_No response_

### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

_No response_
javeme commented 2 years ago

@zhouliweb 感谢反馈,直接使用rest-api方式发送请求会报错吗? rest-api方式执行gremlin文档:https://hugegraph.apache.org/docs/clients/restful-api/gremlin/