You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "stephen mallette (JIRA)" <ji...@apache.org> on 2018/12/03 17:35:00 UTC
[jira] [Closed] (TINKERPOP-2109) gremlin subgraph step fail when
vertices contains properties with null values
[ https://issues.apache.org/jira/browse/TINKERPOP-2109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stephen mallette closed TINKERPOP-2109.
---------------------------------------
Resolution: Not A Bug
I don't think there is much we can do to change this. As a rule, TinkerPop doesn't allow {{null}} properties and TinkerGraph adheres to that. I have a couple of workarounds to consider:
Wrap {{TinkerGraph}} in a new {{Graph}} instance and trap the calls to {{TinkerVertex.property()}} and deal with the nulls. Then subgraph into you wrapper instead of the default TinkerGraph.
Or, {{SubgraphStep}} is really simple - write a custom {{SubgraphStep}} and a OrientDB {{TraversalStrategy}} that replaces the TinkerPop {{SubgraphStep}} with yours. Basically just need to change this line:
https://github.com/apache/tinkerpop/blob/ec13939b799868018de37a725a511de80f5d6683/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SubgraphStep.java#L119
That would be a good contribution to OrientDB. I think doing your an OrientDB specific {{SubgraphStep}} would be the best way to handle this actually. I'd only consider the TinkerGraph-wrapping as a last resort.
> gremlin subgraph step fail when vertices contains properties with null values
> -----------------------------------------------------------------------------
>
> Key: TINKERPOP-2109
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2109
> Project: TinkerPop
> Issue Type: Bug
> Components: tinkergraph
> Affects Versions: 3.3.4
> Reporter: Bruno Supiot
> Priority: Major
>
> We are currently using OrientDB as graph database backend. OrientDB allows properties with null values. The orientdb database is requested with Groovy/Gremlin request.
> When we are requesting for a 'subgraph' step (which use the tinkergraph on memory database for creating the subgraph), an exception is thrown when the vertex of Orientdb contains properties with null values:
> Part of the exception trace:
> Caused by: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of the GREMLIN script
> DB name="connectitdb"
> at org.apache.tinkerpop.gremlin.orientdb.executor.StorageGremlinExecutor.executeGremlinNative(StorageGremlinExecutor.java:78)
> at org.apache.tinkerpop.gremlin.orientdb.executor.StorageGremlinExecutor.executeGremlinNative(StorageGremlinExecutor.java:54)
> at com.activus.connectit.storage.service.graph.TinkerpopGraphService.executeGroovyGremlinScript(TinkerpopGraphService.java:149)
> ... 105 common frames omitted
> Caused by: javax.script.ScriptException: javax.script.ScriptException: java.lang.IllegalArgumentException: Property value can not be null
> at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:406)
> at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
> at org.apache.tinkerpop.gremlin.orientdb.executor.StorageGremlinExecutor.executeGremlinNative(StorageGremlinExecutor.java:72)
> ... 107 common frames omitted
> Caused by: javax.script.ScriptException: java.lang.IllegalArgumentException: Property value can not be null
> at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:722)
> at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:404)
> ... 109 common frames omitted
> Caused by: java.lang.IllegalArgumentException: Property value can not be null
> at org.apache.tinkerpop.gremlin.structure.Property$Exceptions.propertyValueCanNotBeNull(Property.java:143)
> at org.apache.tinkerpop.gremlin.structure.util.ElementHelper.validateProperty(ElementHelper.java:97)
> at org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex.property(TinkerVertex.java:87)
> at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphStep.lambda$getOrCreate$2(SubgraphStep.java:119)
> at java.util.Iterator.forEachRemaining(Iterator.java:116)
> at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphStep.getOrCreate(SubgraphStep.java:117)
> at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphStep.addEdgeToSubgraph(SubgraphStep.java:135)
> at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphStep.sideEffect(SubgraphStep.java:80)
> at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep.processNextStart(SideEffectStep.java:39)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
> at org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep.processNextStart(FlatMapStep.java:48)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.hasNext(ExpandableStepIterator.java:42)
> at org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep.processAllStarts(NoOpBarrierStep.java:66)
> at org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep.processNextStart(NoOpBarrierStep.java:55)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
> at org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep.processNextStart(FlatMapStep.java:48)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
> at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep.processNextStart(SideEffectStep.java:38)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
> at org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep.processNextStart(FlatMapStep.java:48)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.hasNext(ExpandableStepIterator.java:42)
> at org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep.processAllStarts(NoOpBarrierStep.java:66)
> at org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep.processNextStart(NoOpBarrierStep.java:55)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
> at org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep.processNextStart(FlatMapStep.java:48)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
> at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep.processNextStart(SideEffectStep.java:38)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
> at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)