{"record":{"id":"f494d1e9c4dae486","repo":"apache/cassandra","slug":"missing-name-argument-in-column-spec","errorCode":null,"errorMessage":"Missing name argument in column spec","messagePattern":"Missing name argument in column spec","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/StressProfile.java","lineNumber":257,"sourceCode":"            tableCql = null;\n        }\n\n        columnConfigs = new HashMap<>();\n\n        if (yaml.columnspec != null)\n        {\n            for (Map<String, Object> spec : yaml.columnspec)\n            {\n                lowerCase(spec);\n                String name = (String) spec.remove(\"name\");\n                DistributionFactory population = !spec.containsKey(\"population\") ? null : OptionDistribution.get((String) spec.remove(\"population\"));\n                DistributionFactory size = !spec.containsKey(\"size\") ? null : OptionDistribution.get((String) spec.remove(\"size\"));\n                DistributionFactory clustering = !spec.containsKey(\"cluster\") ? null : OptionDistribution.get((String) spec.remove(\"cluster\"));\n\n                if (!spec.isEmpty())\n                    throw new IllegalArgumentException(\"Unrecognised option(s) in column spec: \" + spec);\n                if (name == null)\n                    throw new IllegalArgumentException(\"Missing name argument in column spec\");\n\n                GeneratorConfig config = new GeneratorConfig(seedStr + name, clustering, size, population);\n                columnConfigs.put(name, config);\n            }\n        }\n    }\n\n    public void maybeCreateSchema(StressSettings settings)\n    {\n        if (!schemaCreated)\n        {\n            JavaDriverClient client = settings.getJavaDriverClient();\n\n            if (keyspaceCql != null)\n            {\n                try\n                {\n                    client.execute(keyspaceCql, org.apache.cassandra.db.ConsistencyLevel.ONE);","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/StressProfile.java#L239-L275","documentation":"Every column spec in a stress profile YAML must include a 'name' key identifying the column it configures. init throws this IllegalArgumentException when a spec map has no name key. The name is required to seed the value generator and map the config to a schema column.","triggerScenarios":"profile.init(yaml) encountering a column spec entry that specifies population/size/cluster but omits the mandatory 'name' key.","commonSituations":"Hand-editing YAML and deleting the name line, YAML indentation errors that break key association, copy-pasting partial spec blocks.","solutions":["Add the required 'name' key to each column spec in the YAML","Verify YAML indentation so 'name' belongs to the same spec mapping","Compare against an example stress profile YAML for the correct structure"],"exampleFix":"# before\ncolumnspec:\n  population: uniform(1..1M)\n# after\ncolumnspec:\n  name: c1\n  population: uniform(1..1M)","handlingStrategy":"validation","validationCode":"// require name in each column spec\nif (!specMap.containsKey(\"name\")) throw new IllegalArgumentException(\"column spec missing 'name'\");","typeGuard":null,"tryCatchPattern":"try { profile.init(yaml); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"Missing name\")) log.error(\"Add 'name' to every columnspec entry\"); throw e; }","preventionTips":["Always list 'name' first in each column spec","Check YAML indentation so keys bind to the right mapping","Lint the YAML before running stress"],"tags":["yaml","configuration","cassandra-stress"],"backgroundTag":"missing-required-config-field","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"}