{"record":{"id":"4f8257c918bbd9bf","repo":"apache/cassandra","slug":"is-not-a-valid-type","errorCode":null,"errorMessage":" is not a valid type","messagePattern":" is not a valid type","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/settings/SettingsColumn.java","lineNumber":105,"sourceCode":"            }\n\n            if (!(parsed instanceof TimeUUIDType || parsed instanceof AsciiType || parsed instanceof UTF8Type))\n            {\n                System.err.println(\"Currently supported types are: TimeUUIDType, AsciiType, UTF8Type.\");\n                System.exit(1);\n            }\n        }\n        if (name != null)\n        {\n            assert count == null;\n\n            AbstractType comparator;\n            try\n            {\n                comparator = TypeParser.parse(this.comparator);\n            } catch (Exception e)\n            {\n                throw new IllegalArgumentException(this.comparator + \" is not a valid type\");\n            }\n\n            final String[] names = name.name.value().split(\",\");\n            this.names = new ArrayList<>(names.length);\n\n            for (String columnName : names)\n                this.names.add(comparator.fromString(columnName));\n            Collections.sort(this.names, BytesType.instance);\n            this.namestrs = new ArrayList<>();\n            for (ByteBuffer columnName : this.names)\n                this.namestrs.add(comparator.getString(columnName));\n\n            final int nameCount = this.names.size();\n            countDistribution = new DistributionFactory()\n            {\n                @Override\n                public Distribution get()\n                {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/settings/SettingsColumn.java#L87-L123","documentation":"SettingsColumn parses the comparator string (e.g. 'UTF8Type' or 'IntegerType') with Cassandra's TypeParser to build an AbstractType. If TypeParser cannot resolve the string to a known type, the SettingsColumn constructor wraps the failure in this IllegalArgumentException, discarding the underlying cause.","triggerScenarios":"Running cassandra-stress with -col comparator=<value> where the value is not a parseable Cassandra type name — e.g. a typo like 'Utf8' instead of 'UTF8Type', a fully-qualified class that isn't on the classpath, or an invalid composite type expression.","commonSituations":"Confusing CQL type names (text, int) with the comparator AbstractType names (UTF8Type, Int32Type); copying a type alias unsupported by the stress tool version; malformed nested/composite type syntax like 'CompositeType(utf8' missing a closing paren.","solutions":["Use the exact AbstractType class name, e.g. -col comparator=UTF8Type (not 'UTF8' or 'text').","Test the type string with TypeParser or against the list of built-in types (AsciiType, UTF8Type, IntegerType, TimeUUIDType, etc.).","Fix composite syntax, e.g. comparator=CompositeType(UTF8Type, Int32Type).","If using a custom type, ensure the class is on the cassandra-stress classpath."],"exampleFix":"// before\ncassandra-stress write n=1M -col comparator=text\n// after\ncassandra-stress write n=1M -col comparator=UTF8Type","handlingStrategy":"validation","validationCode":"try { TypeParser.parse(comparatorStr); } catch (Exception e) { throw new IllegalArgumentException(\"invalid comparator: \" + comparatorStr, e); }","typeGuard":null,"tryCatchPattern":"try { /* build column settings */ } catch (IllegalArgumentException e) { if (e.getMessage().endsWith(\"is not a valid type\")) { System.err.println(\"Use e.g. UTF8Type, Int32Type, or CompositeType(...)\"); } throw e; }","preventionTips":["Use AbstractType class names (UTF8Type), not CQL names (text).","Validate composite expressions in a quick TypeParser smoke test before long stress runs.","Keep custom type classes on the stress classpath."],"tags":["cli","types","configuration"],"backgroundTag":"invalid-enum-value","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"}