Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2196

PartitionStrategy with includeMetaProperties(true) can't add labeled vertex

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.1
    • Fix Version/s: 3.3.7, 3.4.2
    • Component/s: process
    • Labels:
      None

      Description

      graph = TinkerGraph.open()
      
      g1 = graph.traversal().withStrategies(PartitionStrategy.build().partitionKey("_partition").writePartition("1").readPartitions("1").create())
      v1 = g1.addV("node").next() // OK
      v2 = g1.addV("node").next() // OK
      
      g2 = graph.traversal().withStrategies(PartitionStrategy.build().partitionKey("_partition").writePartition("1").readPartitions("1").includeMetaProperties(true).create())
      g2.addV() // OK
      g2.addE("link").from(v1).to(v2) // OK
      g2.addV("node") // Exception
      
      

      Trying to add a labeled vertex through a PartitionStrategy that is partitioning meta-properties fails. Adding a non-labeled vertex or a labeled edge succeeds.

      java.lang.ClassCastException: org.apache.tinkerpop.gremlin.structure.T$1 cannot be cast to java.lang.String
          at org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy.lambda$null$7(PartitionStrategy.java:220)
          at java.util.HashMap.forEach(HashMap.java:1289)
          at java.util.Collections$UnmodifiableMap.forEach(Collections.java:1505)
          at org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy.lambda$apply$8(PartitionStrategy.java:218)
          at java.util.ArrayList.forEach(ArrayList.java:1257)
          at org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy.apply(PartitionStrategy.java:205)
          at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies.applyStrategies(DefaultTraversalStrategies.java:84)
          at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.applyStrategies(DefaultTraversal.java:119)
          at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:191)
          at org.apache.tinkerpop.gremlin.console.Console$_closure3.doCall(Console.groovy:221)
          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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
          at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
          at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:37)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
          at org.codehaus.groovy.tools.shell.Groovysh.setLastResult(Groovysh.groovy:461)
          at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
          at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
          at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:168)
          at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:199)
          at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
          at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
          at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
          at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:72)
          at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:120)
          at org.codehaus.groovy.tools.shell.Shell$leftShift$1.call(Unknown Source)
          at org.codehaus.groovy.tools.shell.commands.LoadCommand$_load_closure1.doCall(LoadCommand.groovy:84)
          at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
          at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
          at groovy.lang.Closure.call(Closure.java:405)
          at org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForLine(DefaultGroovyMethods.java:5935)
          at org.codehaus.groovy.runtime.IOGroovyMethods.eachLine(IOGroovyMethods.java:457)
          at org.codehaus.groovy.runtime.IOGroovyMethods.eachLine(IOGroovyMethods.java:410)
          at org.codehaus.groovy.runtime.ResourceGroovyMethods.eachLine(ResourceGroovyMethods.java:319)
          at org.codehaus.groovy.runtime.ResourceGroovyMethods.eachLine(ResourceGroovyMethods.java:303)
          at org.codehaus.groovy.runtime.dgm$994.invoke(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:244)
          at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
          at org.codehaus.groovy.tools.shell.commands.LoadCommand.load(LoadCommand.groovy:80)
          at org.codehaus.groovy.tools.shell.commands.LoadCommand$load.callCurrent(Unknown Source)
          at org.codehaus.groovy.tools.shell.commands.LoadCommand.execute(LoadCommand.groovy:69)
          at org.codehaus.groovy.tools.shell.Command$execute.call(Unknown Source)
          at org.codehaus.groovy.tools.shell.CommandAlias.execute(CommandAlias.groovy:84)
          at org.codehaus.groovy.tools.shell.Command$execute.call(Unknown Source)
          at org.codehaus.groovy.tools.shell.Shell.execute(Shell.groovy:102)
          at org.codehaus.groovy.tools.shell.Groovysh.super$2$execute(Groovysh.groovy)
          at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
          at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
          at org.codehaus.groovy.tools.shell.Groovysh.executeCommand(Groovysh.groovy:274)
          at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:167)
          at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
          at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
          at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
          at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:72)
          at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:120)
          at org.codehaus.groovy.tools.shell.Shell$leftShift$1.call(Unknown Source)
          at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:93)
          at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
          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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
          at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
          at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:164)
          at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:138)
          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.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
          at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
          at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:160)
          at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
          at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
          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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
          at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
          at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
          at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:144)
          at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:164)
          at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:97)
          at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:234)
          at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:153)
          at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:234)
          at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:466)
      

      (TINKERPOP-2188 may be related.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                spmallette Stephen Mallette
                Reporter:
                bob_f Bob F
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: