question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with binding when variable is in a solr query.

See original GitHub issue

Describe 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:

  1. create a DSE 5.1.25 cluster with Search enabled where a node contains an som
  2. Create both the schema and populate the table as indicated in cql_iot_basic-schema.yaml
  3. 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.

cql-iot-basic-schema.yaml.txt

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:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Meeraa-Lakshmanancommented, Jan 24, 2022

@msmygit,@jclu123

Thank you so much,Its working.

1reaction
jclu123commented, Jan 21, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

org.apache.solr.client.solrj.beans.BindingException
I added a no variable constructor to the POJO and it started to work. public class MyItem { String id; @Field("id") public void...
Read more >
Major Changes in Solr 9 :: Apache Solr Reference Guide
In Solr 8, it was possible to add docValues to a schema without re-indexing via UninvertDocValuesMergePolicy , an advanced/expert utility. Due to changes...
Read more >
Query using bind variable returns nothing
A good first step here would be to print the value of line you're working with in each iteration (via System.debug() ) to...
Read more >
Spring Data for Apache Solr
Using Streamable as Query Method Return Type ... or the domain class to decide about Spring Data module binding for a repository definition:....
Read more >
Database Solr Query - Documentation | Brightspot CMS
The db-solr tool provides direct access to the Solr databases. Run direct queries against Solr indexing from the db-solr tool using standard Solr...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found