{"record":{"id":"80cf572ddc1ba3f7","repo":"apache/cassandra","slug":"invalid-value-for-property-s-it-should-be-a-se","errorCode":null,"errorMessage":"Invalid value for property '%s'. It should be a set of identifiers.","messagePattern":"Invalid value for property '(.+?)'\\. It should be a set of identifiers\\.","errorType":"validation","errorClass":"SyntaxException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/PropertyDefinitions.java","lineNumber":101,"sourceCode":"    {\n        Object val = properties.get(name);\n        if (val == null)\n            return null;\n        if (!(val instanceof String))\n            throw new SyntaxException(format(\"Invalid value for property '%s'. It should be a string\", name));\n        return (String)val;\n    }\n\n    @Nullable\n    public Set<QualifiedName> getQualifiedNames(String name) throws SyntaxException\n    {\n        Object val = properties.get(name);\n        if (val == null)\n            return null;\n        if (val instanceof Map && ((Map<?, ?>)val).isEmpty()) // to solve the ambiguity between empty map and empty set\n            return Collections.emptySet();\n        if (!(val instanceof Set))\n            throw new SyntaxException(String.format(\"Invalid value for property '%s'. It should be a set of identifiers.\", name));\n        return (Set<QualifiedName>) val;\n    }\n\n    @Nullable\n    protected Map<String, String> getMap(String name) throws SyntaxException\n    {\n        Object val = properties.get(name);\n        if (val == null)\n            return null;\n        if (val instanceof Set && ((Set<?>)val).isEmpty()) // to solve the ambiguity between empty map and empty set\n            return Collections.emptyMap();\n        if (!(val instanceof Map))\n            throw new SyntaxException(format(\"Invalid value for property '%s'. It should be a map.\", name));\n        return (Map<String, String>)val;\n    }\n\n    public boolean getBoolean(String key, boolean defaultValue) throws SyntaxException\n    {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/PropertyDefinitions.java#L83-L119","documentation":"PropertyDefinitions.getQualifiedNames() fetches a WITH-clause property that must be a Set<QualifiedName>. Since an empty map and empty set parse ambiguously, empty maps are tolerated as empty sets, but any other non-Set value triggers a SyntaxException stating the value must be a set of identifiers.","triggerScenarios":"Supplying a scalar, string, or map value for a property expected to be a set of identifiers (e.g. collection options on CREATE TABLE like CLUSTERING ORDER-related identifier sets).","commonSituations":"Parenthesization errors: writing option = 'id' instead of option = (id); query builders emitting the wrong literal shape; ambiguous empty value handling.","solutions":["Rewrite the property value as a parenthesized set of identifiers: option = (id1, id2).","If the value should be empty, ensure it parses as an empty set/map and check how your tool serializes it.","Fix the query builder to emit Set<QualifiedName> values for such properties."],"exampleFix":"-- before\nCREATE TABLE t (...) WITH option = 'col1'; -- string, not a set\n-- after\nCREATE TABLE t (...) WITH option = (col1);","handlingStrategy":"type-guard","validationCode":"Object v = options.get(name); if (v != null && !(v instanceof Set) && !(v instanceof Map)) throw new IllegalArgumentException(name + \" must be a set of identifiers\");","typeGuard":"boolean isSetOfIdentifiers(Object v) { return v == null || (v instanceof Map && ((Map<?,?>) v).isEmpty()) || v instanceof Set; }","tryCatchPattern":"try { session.execute(ddl); } catch (SyntaxException e) { if (e.getMessage().contains(\"set of identifiers\")) { /* wrap value in parentheses */ } else throw e; }","preventionTips":["Emit set literals as (id1, id2) in generated CQL","Type properties as Set<QualifiedName> in builders","Add DDL rendering unit tests"],"tags":["cql","syntax","type-mismatch"],"backgroundTag":"config-type-mismatch","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"}