Problem with binding when variable is in a solr query.
See original GitHub issueDescribe the bug redacted is working on a redacted project that makes heavy use of Solr due to a need for string pattern matching. They want to load test ther Solr config using NB, and ran into a binding problem when using solr; the schema cql-iot-basic-schema used here is attached… In short the
solr_query = ‘{“q”:“idx_col3:{type}”}’
causes an error. But if {type} were substituted with an actual string, then it works.
However, if the driver were set to “stdout” (i.e. not writing to DSE at all), then {type} binding causes no problems and the entire scenario runs correctly without error.
To Reproduce Steps to reproduce the behavior:
- create a DSE 5.1.25 cluster with Search enabled where a node contains an som
- Create both the schema and populate the table as indicated in cql_iot_basic-schema.yaml
- Run the following nb command:
nb run driver=cql workload=cql-iot-basic-schema host=anIpOfDseNode tags=phase:main cycles=1000 port=9042 -v
You will get an error about binding (see toward the bottom of this post). Then run
nb run driver=stdout workload=cql-iot-basic-schema host=anIpOfDseNode tags=phase:main cycles=1000 port=9042 -v
You will not get an error and the output looks correct.
What was Expected I should see solr_query successfully invoked against the DSE cluster and NB run successfully (as in the driver=stdout case).
Additional context NB runs in Linux, DSE is v5.1.25. nb version is 3.12.106, although this problem also happens upto 4.15.64.
Error of the binding looks like this
2022-01-18 19:48:08,219 INFO [scenarios:001] i.n.e.c.ActivityExecutor [ActivityExecutor.java:169] Stopping executor for cql-iot-basic-schema when work completes. 2022-01-18 19:48:08,223 ERROR [cql-iot-basic-schema:001] i.n.e.a.a.m.CoreMotor [CoreMotor.java:465] Error in core motor loop:java.lang.RuntimeException: Binding error:BindingsTemplate:'type'=>"WeightedStrings('AU:.5;FXK:.25;ECOM:.5');ToString();"=>[AU](String) java.lang.RuntimeException: Binding error:BindingsTemplate:'type'=>"WeightedStrings('AU:.5;FXK:.25;ECOM:.5');ToString();"=>[AU](String) at io.nosqlbench.virtdata.core.bindings.ContextualArrayBindings.bind(ContextualArrayBindings.java:41) at io.nosqlbench.activitytype.cql.statements.core.ReadyCQLStatement.bind(ReadyCQLStatement.java:47) at io.nosqlbench.activitytype.cql.core.CqlAction.runPhase(CqlAction.java:91) at io.nosqlbench.activitytype.cql.core.CqlAction.runCycle(CqlAction.java:72)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
@msmygit,@jclu123
Thank you so much,Its working.
@msmygit your suggestion works, thank you very much (although that is some next level nb-binding incantation you conjured up there). @Meeraa-Lakshmanan, please follow what Madhavan suggested.