{"record":{"id":"4d9ed777ea323fc6","repo":"apache/seatunnel","slug":"tables-configs-d-cql-must-not-be-blank","errorCode":null,"errorMessage":"tables_configs[%d]: 'cql' must not be blank","messagePattern":"tables_configs\\[(.+?)\\]: 'cql' must not be blank","errorType":"validation","errorClass":"OptionValidationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/source/CassandraSourceFactory.java","lineNumber":96,"sourceCode":"\n    static class TableConfigsValidator implements ConditionExtension<List<Map<String, Object>>> {\n\n        @Override\n        public String description() {\n            return \"each 'tables_configs' entry must contain a non-blank 'cql'\";\n        }\n\n        @Override\n        public boolean evaluate(ReadonlyConfig config, List<Map<String, Object>> entries)\n                throws OptionValidationException {\n            if (entries == null || entries.isEmpty()) {\n                return true;\n            }\n            for (int i = 0; i < entries.size(); i++) {\n                Map<String, Object> tableConfig = entries.get(i);\n                Object cql = tableConfig == null ? null : tableConfig.get(CQL.key());\n                if (!(cql instanceof String) || ((String) cql).trim().isEmpty()) {\n                    throw new OptionValidationException(\n                            \"tables_configs[%d]: 'cql' must not be blank\", i);\n                }\n            }\n            return true;\n        }\n    }\n\n    @Override\n    public <T, SplitT extends SourceSplit, StateT extends Serializable>\n            TableSource<T, SplitT, StateT> createSource(TableSourceFactoryContext context) {\n        CassandraParameters cassandraParameters = new CassandraParameters();\n        cassandraParameters.buildWithConfig(context.getOptions());\n        return () ->\n                (SeaTunnelSource<T, SplitT, StateT>)\n                        new CassandraSource(cassandraParameters, context.getOptions());\n    }\n\n    @Override","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/source/CassandraSourceFactory.java#L78-L114","documentation":"This validation error is thrown by CassandraSourceFactory's tables_configs option validator when a table entry in tables_configs has a missing, non-string, or blank (whitespace-only) 'cql' value. Each entry in tables_configs must carry the CQL query used to read rows from Cassandra, so the factory rejects any entry that cannot supply one. It fails fast at config-evaluation time, before any connection is made.","triggerScenarios":"Configuring the Cassandra source with tables_configs where an entry omits 'cql', sets it to null, sets it to a non-string (e.g. number/object via HOCON), or sets it to \"\" or \"   \".","commonSituations":"Copy-pasting a tables_configs template and forgetting to fill in the cql field; quoting/nesting mistakes in HOCON that turn cql into a non-string; trailing whitespace-only placeholder values; defining multiple table entries and leaving one empty.","solutions":["Add a non-blank 'cql' string to every entry in tables_configs (e.g. cql = \"SELECT id, name FROM keyspace.table\")","Check the entry index in the message (tables_configs[N]) to find the offending entry in your config file","Remove any null/placeholder or whitespace-only cql values","Ensure cql is a quoted string in the config format you use (HOCON/JSON), not a number or object"],"exampleFix":"// before\ntables_configs = [\n  { \"table-names\" = \"keyspace.t1\", \"cql\" = \"\" }\n]\n// after\ntables_configs = [\n  { \"table-names\" = \"keyspace.t1\", \"cql\" = \"SELECT id, name FROM keyspace.t1\" }\n]","handlingStrategy":"validation","validationCode":"for (Map<String, Object> t : tablesConfigs) {\n    Object cql = t == null ? null : t.get(\"cql\");\n    if (!(cql instanceof String) || ((String) cql).trim().isEmpty()) {\n        throw new IllegalArgumentException(\"every tables_configs entry needs a non-blank 'cql'\");\n    }\n}","typeGuard":"boolean hasCql(Map<String, Object> t) {\n    return t != null && t.get(\"cql\") instanceof String s && !s.trim().isEmpty();\n}","tryCatchPattern":null,"preventionTips":["Fill in cql for every tables_configs entry when copying config templates","Pre-validate HOCON config values are strings, not nested objects","Trim and check cql strings before submitting the job"],"tags":["cassandra","config-validation","source-connector"],"backgroundTag":"empty-required-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}