apache/cassandra · error · IllegalArgumentException
No bulk read query defined with name
Error message
No bulk read query defined with name ${name} What it means
getBulkReadQueries looks up a token-range (bulk read) query definition by name from the profile YAML. If no TokenRangeQueryDef exists under that name, an IllegalArgumentException is thrown. Bulk read queries must be explicitly declared in the profile.
Solutions
- Define the token-range query in the profile YAML under the correct section
- Fix the name typo in the operation invocation
- Use a query name that exists in the profile (check the YAML)
- Use a profile that supports bulk reads if that is the intent
Example fix
# before stress read profile=p.yaml op=bulkread # after (yaml defines tokenrangequery 'scan1') stress read profile=p.yaml op=scan1
Defensive patterns
Strategy: validation
Validate before calling
if (!yamlProfile.getTokenRangeQueries().containsKey(name)) throw new IllegalArgumentException("unknown bulk read query: " + name); Try / catch
try { profile.getBulkReadQueries(name, ...); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("No bulk read query defined")) log.error("Define token-range query '{}' in profile YAML", name); throw e; } Prevention
- Declare token-range/bulk read queries in the profile before running them
- Use exact names from the YAML
- Confirm the chosen profile supports bulk reads
When it happens
Trigger: Calling profile.getBulkReadQueries(name, ...) with a name not present in the tokenRangeQueries map built from the YAML's token-range query definitions.
Common situations: Typos in the bulk read query name, running a bulk-read operation against a profile that defines no token range queries, copying commands between profiles.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Missing name argument in column spec
- No query defined with name
- Unrecognised insert option(s)
- Unrecognised option(s) in column spec
- Config contains both old and new keys for the same…
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/697e01b224b1b6ce.
Report an issue: GitHub.
Appendix: source
Thrown at tools/stress/src/org/apache/cassandra/stress/StressProfile.java:471
throw new IllegalArgumentException("could not parse update query:" + statement.getQueryString(), e);
}
/*
* here we differentiate between static vs dynamic conditions:
* - static condition example: if col1 = NULL
* - dynamic condition example: if col1 = ?
* for static condition we don't have to replace value, no extra work involved.
* for dynamic condition we have to read existing db value and then
* use current db values during the update.
*/
return modificationStatement.getConditions().stream().anyMatch(ColumnCondition.Raw::containsBindMarkers);
}
public Operation getBulkReadQueries(String name, Timer timer, StressSettings settings, TokenRangeIterator tokenRangeIterator, boolean isWarmup)
{
StressYaml.TokenRangeQueryDef def = tokenRangeQueries.get(name);
if (def == null)
throw new IllegalArgumentException("No bulk read query defined with name " + name);
return new TokenRangeQuery(timer, settings, tableMetaData, tokenRangeIterator, def, isWarmup);
}
public PartitionGenerator getOfflineGenerator()
{
org.apache.cassandra.schema.TableMetadata metadata = CreateTableStatement.parse(tableCql, keyspaceName).build();
//Add missing column configs
Iterator<ColumnMetadata> it = metadata.allColumnsInSelectOrder();
while (it.hasNext())
{
ColumnMetadata c = it.next();
if (!columnConfigs.containsKey(c.name.toString()))
columnConfigs.put(c.name.toString(), new GeneratorConfig(seedStr + c.name.toString(), null, null, null));
}
View on GitHub (pinned to 88fd0f6a0e)