{"record":{"id":"56507014af593676","repo":"apache/seatunnel","slug":"table-path-and-sql-parameter-cannot-be-both-em","errorCode":null,"errorMessage":"`table_path` and `sql` parameter cannot be both empty.","messagePattern":"`table_path` and `sql` parameter cannot be both empty\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/config/ClickhouseTableConfig.java","lineNumber":105,"sourceCode":"                            .batchSize(readonlyConfig.get(CLICKHOUSE_BATCH_SIZE))\n                            .splitSize(readonlyConfig.get(CLICKHOUSE_SPLIT_SIZE))\n                            .build();\n\n            tableList = Collections.singletonList(tableConfig);\n        }\n\n        if (tableList == null || tableList.isEmpty()) {\n            throw new ClickhouseConnectorException(\n                    ClickhouseConnectorErrorCode.GET_TABLE_LIST_CONFIG_ERROR,\n                    String.format(\n                            \"PluginName: %s, PluginType: %s, Message: %s\",\n                            \"Clickhouse\", PluginType.SOURCE, \"Get table list config error.\"));\n        }\n\n        for (ClickhouseTableConfig tableConfig : tableList) {\n            if (StringUtils.isEmpty(tableConfig.getTablePath())\n                    && StringUtils.isEmpty(tableConfig.getSql())) {\n                throw new IllegalArgumentException(\n                        \"`table_path` and `sql` parameter cannot be both empty.\");\n            }\n\n            if (tableConfig.getBatchSize() <= 0) {\n                tableConfig.setBatchSize(CLICKHOUSE_BATCH_SIZE.defaultValue());\n            }\n\n            if (tableConfig.getSplitSize() <= 0) {\n                tableConfig.setSplitSize(CLICKHOUSE_SPLIT_SIZE.defaultValue());\n            }\n\n            tableConfig.setSqlStrategyRead(StringUtils.isNotEmpty(tableConfig.getSql()));\n        }\n\n        return tableList;\n    }\n\n    public TablePath getTableIdentifier() {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/config/ClickhouseTableConfig.java#L87-L123","documentation":"After ClickhouseTableConfig.of builds the table list, it validates each entry: a table config must supply at least one of table_path or sql. If both are empty it throws IllegalArgumentException with this message. Unlike error 658 this is a per-entry validation, so one bad entry in table_list fails the whole config.","triggerScenarios":"A table_list entry (or single-table config parsed from a plugin-level path) where both getTablePath() and getSql() return empty strings/null — e.g. a table_list element that specifies only connection options, or table_path present but blank (\"\" or whitespace).","commonSituations":"table_list entries with an empty table_path string; users intending 'read everything' by leaving table_path blank; blank value from a templated config where a variable expanded to empty string; setting neither sql nor table_path inside a multi-table config.","solutions":["Set a non-empty table_path for every table_list entry (e.g. \"database.table\").","Or provide a non-empty 'sql' for the entry instead of table_path.","Validate the generated config: ensure template variables used in table_path actually resolve to non-empty values.","Add pre-flight config validation in your deployment pipeline to reject entries missing both fields before job submission."],"exampleFix":"// before\ntable_list = [\n  { database_name = \"default\", table_name = \"\" }\n]\n// after\ntable_list = [\n  { table_path = \"default.my_table\" }\n]","handlingStrategy":"validation","validationCode":"boolean hasTablePath = config.containsKey(\"table_path\") && !config.getString(\"table_path\", \"\").trim().isEmpty();\nboolean hasSql = config.containsKey(\"sql\") && !config.getString(\"sql\", \"\").trim().isEmpty();\nif (!hasTablePath && !hasSql) { throw new IllegalArgumentException(\"Each table entry needs non-empty table_path or sql\"); }","typeGuard":null,"tryCatchPattern":"try { tableConfigs = ClickhouseTableConfig.of(readonlyConfig); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"table_path` and `sql\")) { log.error(\"A table_list entry is missing both table_path and sql\"); } throw e; }","preventionTips":["For every table_list entry, fill in table_path or sql — never leave both blank.","Check template expansion: a variable used for table_path must resolve to a non-empty value.","Run a config linter over table_list arrays before job submission."],"tags":["clickhouse","config","validation","table-list"],"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-14T05:17:10.506Z"}