nosqlbench
nosqlbench copied to clipboard
Invalid list literal for media: bind variables are not supported inside collection literals
Describe the bug
- Driver used:
CQL
- NB version:
5.17.2-release
A binding to achieve a collection of User-Defined Type (aka UDT) is required.
If I've a CQL table structure like below:
CREATE TYPE test.media_data (
i int,
j text
);
CREATE TABLE test.udt_test (
a int PRIMARY KEY,
m_d frozen<media_data>
);
with a binding such as below:
bindings:
a: HashRange(1,100); -> int
i: HashRange(1,100) ->int
j: NumberNameToString();
blocks:
insertudt:
ops:
prepared: |
INSERT INTO TEMPLATE(keyspace,test).TEMPLATE(table,udt_test)(a, m_d) VALUES ({a},{i:{i},j:{j}});
I can simply call the below:
java -jar nb5.jar run driver=cqld4 workload=./udt.yaml tags=block:insertudt keyspace=test table=udt_test --show-stacktraces cycles=10 host=localhost localdc=dc1
Whereas, if I use a list of UDTs by representing it within square braces [
& ]
like as below:
...
INSERT INTO TEMPLATE(keyspace,test).TEMPLATE(table,udt_test)(a, media) VALUES ({a},[{i:{i},j:{j}}]);
...
to insert data into a cql data type column such as below:
media frozen<list<frozen<media_data>>>
I get an error stack as below:
**Expand/Collapse Stacktrace**
3560 ERROR [scenarios:001] SCENARIO Error in scenario, shutting down. (javax.script.ScriptException: io.nosqlbench.api.errors.OpConfigError: Error while configuring op from workload template: [from:yaml:./udt.yaml] cause: OpConfigError:Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]') Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]'))
3578 WARN [main] NBCLI executions: 1 scenarios, 0 normal, 1 errored
3581 ERROR [main] ERRORHANDLER Error from driver or included library: javax.script.ScriptException: io.nosqlbench.api.errors.OpConfigError: Error while configuring op from workload template: [from:yaml:./udt.yaml] cause: OpConfigError:Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]') Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]')
java.lang.RuntimeException: javax.script.ScriptException: io.nosqlbench.api.errors.OpConfigError: Error while configuring op from workload template: [from:yaml:./udt.yaml] cause: OpConfigError:Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]') Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]')
at io.nosqlbench.engine.core.lifecycle.scenario.Scenario.executeScenarioScripts(Scenario.java:335)
at io.nosqlbench.engine.core.lifecycle.scenario.Scenario.runScenario(Scenario.java:269)
at io.nosqlbench.engine.core.lifecycle.scenario.Scenario.call(Scenario.java:406)
at io.nosqlbench.engine.core.lifecycle.scenario.Scenario.call(Scenario.java:63)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: javax.script.ScriptException: io.nosqlbench.api.errors.OpConfigError: Error while configuring op from workload template: [from:yaml:./udt.yaml] cause: OpConfigError:Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]') Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]')
at io.nosqlbench.engine.api.activityimpl.SimpleActivity.createOpSourceFromParsedOps(SimpleActivity.java:523)
at io.nosqlbench.engine.api.activityimpl.uniform.StandardActivity.<init>(StandardActivity.java:135)
at io.nosqlbench.engine.api.activityimpl.uniform.StandardActivityType.getActivity(StandardActivityType.java:62)
at io.nosqlbench.engine.api.activityimpl.uniform.StandardActivityType.getActivity(StandardActivityType.java:36)
at io.nosqlbench.engine.api.activityapi.core.ActivityType.getAssembledActivity(ActivityType.java:63)
at io.nosqlbench.engine.core.lifecycle.activity.ActivityLoader.loadActivity(ActivityLoader.java:45)
at io.nosqlbench.engine.core.lifecycle.scenario.ScenarioController.doStartActivity(ScenarioController.java:84)
at io.nosqlbench.engine.core.lifecycle.scenario.ScenarioController.run(ScenarioController.java:135)
at io.nosqlbench.engine.core.lifecycle.scenario.ScenarioController.run(ScenarioController.java:116)
at io.nosqlbench.engine.core.lifecycle.scenario.ScenarioController.run(ScenarioController.java:145)
at io.nosqlbench.engine.core.lifecycle.scenario.script.bindings.PolyglotScenarioController.run(PolyglotScenarioController.java:57)
at <js>.:program(<eval>:1)
at org.graalvm.polyglot.Context.eval(Context.java:399)
at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:478)
at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:420)
at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
at io.nosqlbench.engine.core.lifecycle.scenario.Scenario.executeScenarioScripts(Scenario.java:311)
... 7 more
Caused by: io.nosqlbench.api.errors.OpConfigError: Error while configuring op from workload template: [from:yaml:./udt.yaml] cause: OpConfigError:Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]') Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]')
at io.nosqlbench.engine.api.activityimpl.SimpleActivity.createOpSourceFromParsedOps(SimpleActivity.java:523)
at io.nosqlbench.engine.api.activityimpl.uniform.StandardActivity.<init>(StandardActivity.java:135)
at io.nosqlbench.engine.api.activityimpl.uniform.StandardActivityType.getActivity(StandardActivityType.java:62)
at io.nosqlbench.engine.api.activityimpl.uniform.StandardActivityType.getActivity(StandardActivityType.java:36)
at io.nosqlbench.engine.api.activityapi.core.ActivityType.getAssembledActivity(ActivityType.java:63)
at io.nosqlbench.engine.core.lifecycle.activity.ActivityLoader.loadActivity(ActivityLoader.java:45)
at io.nosqlbench.engine.core.lifecycle.scenario.ScenarioController.doStartActivity(ScenarioController.java:84)
at io.nosqlbench.engine.core.lifecycle.scenario.ScenarioController.run(ScenarioController.java:135)
at io.nosqlbench.engine.core.lifecycle.scenario.ScenarioController.run(ScenarioController.java:116)
at io.nosqlbench.engine.core.lifecycle.scenario.ScenarioController.run(ScenarioController.java:145)
at io.nosqlbench.engine.core.lifecycle.scenario.script.bindings.PolyglotScenarioController.run(PolyglotScenarioController.java:57)
at com.oracle.truffle.host.HostMethodDesc$SingleMethod$MHBase.invokeHandle(HostMethodDesc.java:350)
at com.oracle.truffle.host.GuestToHostCodeCache$1.executeImpl(GuestToHostCodeCache.java:96)
at com.oracle.truffle.host.GuestToHostRootNode.execute(GuestToHostRootNode.java:80)
at com.oracle.truffle.api.impl.DefaultCallTarget.callDirectOrIndirect(DefaultCallTarget.java:85)
at com.oracle.truffle.api.impl.DefaultRuntimeAccessor$DefaultRuntimeSupport.callInlined(DefaultRuntimeAccessor.java:177)
at com.oracle.truffle.host.GuestToHostRootNode.guestToHostCall(GuestToHostRootNode.java:102)
at com.oracle.truffle.host.HostMethodDesc$SingleMethod$MHBase.invokeGuestToHost(HostMethodDesc.java:386)
at com.oracle.truffle.host.HostExecuteNode.doInvoke(HostExecuteNode.java:871)
at com.oracle.truffle.host.HostExecuteNode.doOverloadedCached(HostExecuteNode.java:288)
at com.oracle.truffle.host.HostExecuteNodeGen.executeAndSpecialize(HostExecuteNodeGen.java:241)
at com.oracle.truffle.host.HostExecuteNodeGen.execute(HostExecuteNodeGen.java:97)
at com.oracle.truffle.host.HostObject.invokeMember(HostObject.java:454)
at com.oracle.truffle.host.HostObjectGen$InteropLibraryExports$Cached.invokeMemberNode_AndSpecialize(HostObjectGen.java:2696)
at com.oracle.truffle.host.HostObjectGen$InteropLibraryExports$Cached.invokeMember(HostObjectGen.java:2678)
at com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.invokeMember(InteropLibraryGen.java:8328)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$ForeignInvokeNode.executeCall(JSFunctionCallNode.java:1534)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeAndSpecialize(JSFunctionCallNode.java:306)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeCall(JSFunctionCallNode.java:251)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$InvokeNode.execute(JSFunctionCallNode.java:740)
at com.oracle.truffle.js.nodes.access.JSWriteCurrentFrameSlotNodeGen.execute_generic4(JSWriteCurrentFrameSlotNodeGen.java:124)
at com.oracle.truffle.js.nodes.access.JSWriteCurrentFrameSlotNodeGen.execute(JSWriteCurrentFrameSlotNodeGen.java:43)
at com.oracle.truffle.js.nodes.access.JSWriteCurrentFrameSlotNodeGen.executeVoid(JSWriteCurrentFrameSlotNodeGen.java:330)
at com.oracle.truffle.js.nodes.binary.DualNode.execute(DualNode.java:118)
at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:73)
at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:149)
at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:88)
at com.oracle.truffle.api.impl.DefaultCallTarget.callDirectOrIndirect(DefaultCallTarget.java:85)
at com.oracle.truffle.api.impl.DefaultDirectCallNode.call(DefaultDirectCallNode.java:59)
at com.oracle.truffle.js.lang.JavaScriptLanguage$ParsedProgramRoot.execute(JavaScriptLanguage.java:245)
at com.oracle.truffle.api.impl.DefaultCallTarget.callDirectOrIndirect(DefaultCallTarget.java:85)
at com.oracle.truffle.api.impl.DefaultCallTarget.call(DefaultCallTarget.java:102)
at com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:1470)
at com.oracle.truffle.polyglot.PolyglotContextDispatch.eval(PolyglotContextDispatch.java:63)
... 12 more
Caused by: io.nosqlbench.api.errors.OpConfigError: Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]')
at io.nosqlbench.adapter.cqld4.opdispensers.Cqld4PreparedStmtDispenser.createStmtFunc(Cqld4PreparedStmtDispenser.java:71)
at io.nosqlbench.adapter.cqld4.opdispensers.Cqld4PreparedStmtDispenser.<init>(Cqld4PreparedStmtDispenser.java:55)
at io.nosqlbench.adapter.cqld4.opmappers.CqlD4PreparedStmtMapper.apply(CqlD4PreparedStmtMapper.java:73)
at io.nosqlbench.adapter.cqld4.opmappers.Cqld4CoreOpMapper.apply(Cqld4CoreOpMapper.java:74)
at io.nosqlbench.engine.api.activityimpl.SimpleActivity.createOpSourceFromParsedOps(SimpleActivity.java:503)
... 55 more
3587 ERROR [main] ERRORHANDLER cause (see stack trace for details):io.nosqlbench.api.errors.OpConfigError: Error while configuring op from workload template: [from:yaml:./udt.yaml] cause: OpConfigError:Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]') Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]')
javax.script.ScriptException: io.nosqlbench.api.errors.OpConfigError: Error while configuring op from workload template: [from:yaml:./udt.yaml] cause: OpConfigError:Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]') Error while configuring op from workload template: com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Invalid list literal for media: bind variables are not supported inside collection literals( for statement 'parsed: [INSERT INTO test.udt_test(a, media) VALUES (],[a],[,[{i:],[i],[,j:],[j],[}]);
]')
To Reproduce See above ^ bug description for details.
What was Expected Collection of UDTs nicely inserted without any hiccup.
Additional context
Add any other context about the problem here.
OS: macOS Ventura 13.2.1
environment: n/a
version info: 5.17.2-release
Screenshots, if applicable n/a