使用pythongremlin删除AWS Neptune的所有边缘 [英] Drop all edges on AWS Neptune using pythongremlin
问题描述
我正在使用gremlinpython版本3.3.2和AWS NEPTUNE。
我尝试掉掉所有边缘(也尝试了顶点),但每次都会失败。
gE()。drop()。iterate()
给我:
I'm using gremlinpython version 3.3.2 and AWS NEPTUNE.
I try to drop all the edges (tried the vertices too) and it fails everytime.
g.E().drop().iterate()
Gives me:
gremlin_python.driver.protocol.GremlinServerError:597:异常
根据请求处理脚本[RequestMessage {,
requestId = ae49cbb7-e034-4e56-ac76-b62310f753c2,op ='bytecode',
Processor ='traversal',args = {gremlin = [[],[V(),drop()]],
aliases = {g = g}}}]]。
gremlin_python.driver.protocol.GremlinServerError: 597: Exception processing a script on request [RequestMessage{, requestId=ae49cbb7-e034-4e56-ac76-b62310f753c2, op='bytecode', processor='traversal', args={gremlin=[[], [V(), drop()]], aliases={g=g}}}].
有人已经成功删除了AWS Neptune中图形的所有顶点/边吗?
Did anyone already successfuly remove all vertices/edges of a graph in AWS Neptune?
EDIT :
删除特定ID的工作原理是:
gE(id).drop()。iterate()
EDIT2:
这是使用gremlin控制台完成的回溯:
Here is a backtrace done using gremlin console:
gremlin> gE()。count()。next()
gremlin> g.E().count().next()
==> 740839
gremlin> gE()。drop()。iterate()
A t imeout在评估[RequestMessage {,requestId = 24c3d14c-c8be-4ed9-a297-3fd2b38ace9a,op ='eval',> processor ='',args = {gremlin = gE()。drop()。iterate)期间在脚本内发生(),bindings = {},batchSize = 64}}]-考虑增加超时时间
输入':help'或':h'寻求帮助。
显示堆栈跟踪? [yN] y
org.apache.tinkerpop.gremlin.jsr223.console.RemoteException:在[RequestMessage {,> requestId = 24c3d14c-c8be-4ed9-a297-3fd2b38ace9a]评估期间,脚本内发生超时,op ='eval',processor ='',args = {gremlin = gE()。drop()。iterate(),bindings = {},> batchSize = 64}}]]-考虑增加超时时间
在org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:178)
在org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovy groovy:99)
在org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
在org.codehaus.groovy.tools.shell。 ShellRunner.work(ShellRunner.groovy:95)
在org.codehaus.groovy.tools.shell.InteractiveShellRunner.super $ 2 $ work(InteractiveShellRunner.groovy)
在sun.reflect .NativeMethodAccessorImpl.invoke0(本机方法)
在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor Impl.java:62)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java: 498)
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)中的
groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)中的
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)中的
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)中的
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)上的
org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:
130)
在org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)中使用
在org.codehaus.groovy.tools.shell.InteractiveShellRunner中使用
。 super $ 2 $ run(InteractiveShellRunner.groovy)
在sun.refle上
ct.NativeMethodAccessorImpl.invoke0(本机方法)
在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java :43)
java.lang.reflect.Method.invoke(Method.java:498)中的
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java)中的
:98)
groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)的
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)的
在org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
在org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)< br> org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)的
org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface .java:236 )
在org.apache.tinkerpop.gremlin.console.Console。(Console.groovy:146)
在org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod( IndyInterface.java:236)
在org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:453)
gremlin>
==>740839
gremlin> g.E().drop().iterate()
A timeout occurred within the script during evaluation of [RequestMessage{, requestId=24c3d14c-c8be-4ed9-a297-3fd2b38ace9a, op='eval', > processor='', args={gremlin=g.E().drop().iterate(), bindings={}, batchSize=64}}] - consider increasing the timeout
Type ':help' or ':h' for help.
Display stack trace? [yN]y
org.apache.tinkerpop.gremlin.jsr223.console.RemoteException: A timeout occurred within the script during evaluation of [RequestMessage{, > requestId=24c3d14c-c8be-4ed9-a297-3fd2b38ace9a, op='eval', processor='', args={gremlin=g.E().drop().iterate(), bindings={}, > batchSize=64}}] - consider increasing the timeout
at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:178)
at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
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:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
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:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.console.Console.(Console.groovy:146)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:453)
gremlin>
我会说这是一个超时问题,对吧?
I would say it's a timeout problem, right?
推荐答案
确定,因此在与@stephen mallette进行了交流并提出问题并获得AWS支持后,我终于找到了问题所在。
因为它仍然是预览NEPTUNE仍然遇到一些小问题,并且 drop()
是一个。
支持人员提供的解决方法是通过以下方式批量执行 drop()
并行连接:
OK so after some exchange with @stephen mallette in comment of the question and AWS support I finally found where the problem lies.
As it still a preview NEPTUNE still suffer some smalls issues and drop()
is one.
A workaround, given by the support is to perform drop()
in batches via parallel connections:
gV()。limit(1000).drop()
g.V().limit(1000).drop()
因此,即使有5分钟的超时和700.000的边,滴注台现在正在达到超时。
我将更新此答案o n NEPTUNE发布。
So dropping table is hitting a timeout right now, even with a 5 minutes timeout and 700.000 edges.
I will update this answer on NEPTUNE's release.
这篇关于使用pythongremlin删除AWS Neptune的所有边缘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!