在NoSQLBench v5中如何处理UUID类型的查询参数?
NoSQLBench v5中绑定Cassandra UUID主键查询参数的替代方案求助
问题背景
我正在使用NoSQLBench version 5对Cassandra数据库(DataStax DSE 6.8)中的一张表生成查询,该表主键为UUID类型。
示例表结构:
CREATE TABLE test.tab01 ( id uuid, nm text, PRIMARY KEY (id) );
查询需要传入UUID参数:
SELECT nm FROM test.tab01 WHERE id = ?;
旧版实现方式
在旧版NoSQLBench中,我会将表中的id导出到CSV文件,通过**ModuloCSVLineToUUID()**函数绑定查询参数,示例YAML脚本如下:
测试脚本test01.yaml:
scenarios: default: run driver=stdout cycles=10 teste: run driver=cql hosts=srvdse01 localdc=Cassandra cycles=1000 bindings: item : ModuloCSVLineToUUID('ids.csv','id') statements: - cmd1: | select nm from test.tab01 where id = {item};
报错信息
在NoSQLBench v5中运行该脚本时出现如下错误:
$ /opt/nb/nb5 test01 teste 2074 ERROR \[scenarios:001\] SCENARIO Error in scenario, shutting down. (javax.script.ScriptException: java.lang.RuntimeException: There were no functions found for ModuloCSVLineToUUID('ids.csv','id')) 2086 WARN \[main\] NBCLI executions: 1 scenarios, 0 normal, 1 errored 2087 ERROR \[main\] ERRORHANDLER Error from driver or included library: javax.script.ScriptException: java.lang.RuntimeException: There were no functions found for ModuloCSVLineToUUID('ids.csv','id') java.lang.RuntimeException: javax.script.ScriptException: java.lang.RuntimeException: There were no functions found for ModuloCSVLineToUUID('ids.csv','id') 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: java.lang.RuntimeException: There were no functions found for ModuloCSVLineToUUID('ids.csv','id')
求助需求
求在NoSQLBench v5中实现从CSV读取UUID并绑定查询参数的替代方法。
内容的提问来源于stack exchange,提问作者Jose Tecles
相关产品推荐
相关产品推荐

