{"record":{"id":"dfd5f87e3a9a92ac","repo":"apache/seatunnel","slug":"unsupported-sql-syntax-s","errorCode":null,"errorMessage":"Unsupported SQL syntax: %s","messagePattern":"Unsupported SQL syntax: (.+?)","errorType":"exception","errorClass":"ParserException","httpStatus":null,"severity":"error","filePath":"seatunnel-config/seatunnel-config-sql/src/main/java/org/apache/seatunnel/config/sql/SqlConfigBuilder.java","lineNumber":134,"sourceCode":"                    if (createTable.getTableOptionsStrings() == null) {\n                        continue;\n                    }\n                    parseCreateTableSql(createTable, sqlTables, seaTunnelConfig);\n                    it.remove();\n                }\n            }\n\n            AtomicInteger tempTableIndex = new AtomicInteger(1);\n            for (String sql : sqlList) {\n                Statement statement = CCJSqlParserUtil.parse(sql);\n                if (statement instanceof CreateTable) {\n                    CreateTable createTable = (CreateTable) statement;\n                    TransformConfig transformConfig = parseCreateAsSql(createTable, sqlTables);\n                    seaTunnelConfig.getTransformConfigs().add(transformConfig);\n                } else if (statement instanceof Insert) {\n                    parseInsertSql((Insert) statement, sqlTables, seaTunnelConfig, tempTableIndex);\n                } else {\n                    throw new ParserException(\n                            String.format(\"Unsupported SQL syntax: %s\", statement));\n                }\n            }\n\n            // filter out the sink config without 'plugin_input' option\n            seaTunnelConfig.setSinkConfigs(\n                    seaTunnelConfig.getSinkConfigs().stream()\n                            .filter(\n                                    sinkConfig -> {\n                                        boolean containSourceTable = false;\n                                        for (Option option : sinkConfig.getOptions()) {\n                                            if (option.getKey().equals(OPTION_PLUGIN_INPUT_KEY)) {\n                                                containSourceTable = true;\n                                                break;\n                                            }\n                                        }\n                                        return containSourceTable;\n                                    })","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-config/seatunnel-config-sql/src/main/java/org/apache/seatunnel/config/sql/SqlConfigBuilder.java#L116-L152","documentation":"During SqlConfigBuilder.of(List<String>) each statement must be a CreateTable or Insert; anything else (top-level SELECT, ALTER, DROP, SET, etc.) throws ParserException 'Unsupported SQL syntax'. The seatunnel SQL config dialect only supports CREATE TABLE ... WITH (...) and INSERT INTO ... SELECT.","triggerScenarios":"Including statements in the job .sql file that are neither CREATE TABLE nor INSERT, e.g. a bare SELECT, CREATE VIEW, DROP TABLE, or SET clause.","commonSituations":"Copy-pasting standard SQL scripts containing DDL like DROP/ALTER, prepending SET statements as one would in a SQL client, or using SQL features (CTEs, views) not supported by the dialect.","solutions":["Remove or comment out all non-CREATE-TABLE/non-INSERT statements from the config file.","Replace unsupported constructs (views, CTEs) with explicit CREATE TABLE + INSERT INTO ... SELECT.","Check the offending statement printed in the message and rewrite it in the supported dialect.","Configure job-level options via the env block instead of SET-style variables."],"exampleFix":"// before\nSET exec.parallelism = 4;\nCREATE TABLE s WITH ('connector'='fake', 'type'='sink') (id INT);\n// after\nCREATE TABLE s WITH ('connector'='fake', 'type'='sink') (id INT);\n-- parallelism goes in the env block, not SQL statements","handlingStrategy":"validation","validationCode":"for (String stmt : statements) {\n    String kw = stmt.trim().split(\"\\\\s+\")[0].toUpperCase();\n    if (!List.of(\"CREATE\", \"INSERT\").contains(kw)) throw new IllegalArgumentException(\"Unsupported: \" + kw);\n}","typeGuard":null,"tryCatchPattern":"try { Config c = SqlConfigBuilder.of(path); } catch (ParserException e) { /* message names the offending statement */ }","preventionTips":["Only use CREATE TABLE ... WITH and INSERT INTO ... SELECT","No SET/ALTER/DROP/SELECT in job SQL files","Replace views/CTEs with explicit tables","Comment out utility SQL before submitting"],"tags":["sql-config","parser","unsupported-syntax","java"],"backgroundTag":"unsupported-operation","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"}