{"record":{"id":"697e01b224b1b6ce","repo":"apache/cassandra","slug":"no-bulk-read-query-defined-with-name-name","errorCode":null,"errorMessage":"No bulk read query defined with name ${name}","messagePattern":"No bulk read query defined with name (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/StressProfile.java","lineNumber":471,"sourceCode":"            throw new IllegalArgumentException(\"could not parse update query:\" + statement.getQueryString(), e);\n        }\n\n        /*\n         * here we differentiate between static vs dynamic conditions:\n         *  - static condition example: if col1 = NULL\n         *  - dynamic condition example: if col1 = ?\n         *  for static condition we don't have to replace value, no extra work involved.\n         *  for dynamic condition we have to read existing db value and then\n         *  use current db values during the update.\n         */\n        return modificationStatement.getConditions().stream().anyMatch(ColumnCondition.Raw::containsBindMarkers);\n    }\n\n    public Operation getBulkReadQueries(String name, Timer timer, StressSettings settings, TokenRangeIterator tokenRangeIterator, boolean isWarmup)\n    {\n        StressYaml.TokenRangeQueryDef def = tokenRangeQueries.get(name);\n        if (def == null)\n            throw new IllegalArgumentException(\"No bulk read query defined with name \" + name);\n\n        return new TokenRangeQuery(timer, settings, tableMetaData, tokenRangeIterator, def, isWarmup);\n    }\n\n\n    public PartitionGenerator getOfflineGenerator()\n    {\n        org.apache.cassandra.schema.TableMetadata metadata = CreateTableStatement.parse(tableCql, keyspaceName).build();\n\n        //Add missing column configs\n        Iterator<ColumnMetadata> it = metadata.allColumnsInSelectOrder();\n        while (it.hasNext())\n        {\n            ColumnMetadata c = it.next();\n            if (!columnConfigs.containsKey(c.name.toString()))\n                columnConfigs.put(c.name.toString(), new GeneratorConfig(seedStr + c.name.toString(), null, null, null));\n        }\n","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/StressProfile.java#L453-L489","documentation":"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.","triggerScenarios":"Calling profile.getBulkReadQueries(name, ...) with a name not present in the tokenRangeQueries map built from the YAML's token-range query definitions.","commonSituations":"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.","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"],"exampleFix":"# before\nstress read profile=p.yaml op=bulkread\n# after (yaml defines tokenrangequery 'scan1')\nstress read profile=p.yaml op=scan1","handlingStrategy":"validation","validationCode":"if (!yamlProfile.getTokenRangeQueries().containsKey(name)) throw new IllegalArgumentException(\"unknown bulk read query: \" + name);","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["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"],"tags":["cassandra-stress","yaml","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}