{"record":{"id":"418b47e37c77357b","repo":"apache/seatunnel","slug":"either-table-path-or-query-must-be-specified-in-so","errorCode":null,"errorMessage":"Either table path or query must be specified in source configuration.","messagePattern":"Either table path or query must be specified in source configuration\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcCatalogUtils.java","lineNumber":240,"sourceCode":"            throw (SQLException) error;\n        }\n        if (error instanceof ClassNotFoundException) {\n            throw (ClassNotFoundException) error;\n        }\n        if (error instanceof RuntimeException) {\n            return (RuntimeException) error;\n        }\n        return new RuntimeException(error);\n    }\n\n    private static CatalogTable getCatalogTable(\n            JdbcSourceTableConfig tableConfig,\n            AbstractJdbcCatalog jdbcCatalog,\n            JdbcDialect jdbcDialect)\n            throws SQLException {\n        if (Strings.isNullOrEmpty(tableConfig.getTablePath())\n                && Strings.isNullOrEmpty(tableConfig.getQuery())) {\n            throw new IllegalArgumentException(\n                    \"Either table path or query must be specified in source configuration.\");\n        }\n\n        if (StringUtils.isNotEmpty(tableConfig.getTablePath())\n                && StringUtils.isNotEmpty(tableConfig.getQuery())) {\n            TablePath tablePath = jdbcDialect.parse(tableConfig.getTablePath());\n            CatalogTable tableOfPath = null;\n            try {\n                tableOfPath = jdbcCatalog.getTable(tablePath);\n            } catch (Exception e) {\n                // ignore\n                log.debug(\"User-defined table path: {}\", tablePath);\n            }\n            CatalogTable tableOfQuery = jdbcCatalog.getTable(tableConfig.getQuery());\n            if (tableOfPath == null) {\n                String catalogName =\n                        tableOfQuery.getTableId() == null\n                                ? DEFAULT_CATALOG_NAME","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcCatalogUtils.java#L222-L258","documentation":"JdbcCatalogUtils builds a CatalogTable for each configured source table. Each table entry must provide either a table_path or a query; if both are missing, getCatalogTable throws IllegalArgumentException. This is a configuration-validation error thrown before any database interaction.","triggerScenarios":"A JdbcSourceTableConfig in the source's table_list (or single-table config) has an empty/absent table_path and an empty/absent query when getCatalogTable (catalog-driven overload) resolves the table.","commonSituations":"table_list entry with only a database or catalog but no table name; typo such as tablepath or tabel_path; empty string values after variable substitution; user intended to set query but left it blank.","solutions":["Add table_path (e.g. \"database_name.table_name\") to each table_list entry, or","Provide a query (e.g. \"SELECT * FROM db.table WHERE dt='2024-01-01'\") instead","Fix option-name typos and verify substituted variables are non-empty in the rendered config"],"exampleFix":"// before\nJdbcSourceTableConfig t = new JdbcSourceTableConfig();\nt.setTablePath(\"\");\nt.setQuery(null);\n// after\nJdbcSourceTableConfig t = new JdbcSourceTableConfig();\nt.setTablePath(\"mydb.mytable\"); // or t.setQuery(\"SELECT * FROM mydb.mytable\")","handlingStrategy":"validation","validationCode":"import com.google.common.base.Strings;\nif (Strings.isNullOrEmpty(tableConfig.getTablePath()) && Strings.isNullOrEmpty(tableConfig.getQuery())) {\n  throw new IllegalArgumentException(\"table_list entry needs table_path or query\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  CatalogTable ct = JdbcCatalogUtils.getCatalogTable(tableConfig, jdbcCatalog, dialect);\n} catch (IllegalArgumentException e) {\n  log.error(\"Fix source config: {}\", e.getMessage());\n}","preventionTips":["Ensure every table_list entry sets table_path or query","Watch for option-name typos (tablepath vs table_path)","Verify template variables render to non-empty values"],"tags":["jdbc","configuration","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}