apache/seatunnel · error · ParserException
The sink table[%s] is not found
Error message
The sink table[%s] is not found
What it means
Thrown by parseInsertSql when the INSERT target table either does not exist in sqlTables or is not of type 'sink'. Note the message prints pluginInputIdentifier (the source name) instead of the target name — a known message bug — but the check is against targetTableName.
Source
Thrown at seatunnel-config/seatunnel-config-sql/src/main/java/org/apache/seatunnel/config/sql/SqlConfigBuilder.java:417
String query = select.toString();
transformConfig.setPluginInputIdentifier(pluginInputIdentifier);
transformConfig.setPluginOutputIdentifier(pluginOutputIdentifier);
transformConfig.setQuery(query);
seaTunnelConfig.getTransformConfigs().add(transformConfig);
}
if (!sqlTables.containsKey(pluginInputIdentifier)
|| (!OPTION_TABLE_TYPE_SOURCE.equalsIgnoreCase(
sqlTables.get(pluginInputIdentifier).getType())
&& !OPTION_TABLE_TYPE_TRANSFORM.equalsIgnoreCase(
sqlTables.get(pluginInputIdentifier).getType()))) {
throw new ParserException(
String.format("The source table[%s] is not found", pluginInputIdentifier));
}
if (!sqlTables.containsKey(targetTableName)
|| !OPTION_TABLE_TYPE_SINK.equalsIgnoreCase(
sqlTables.get(targetTableName).getType())) {
throw new ParserException(
String.format("The sink table[%s] is not found", pluginInputIdentifier));
}
SinkConfig sinkConfig = (SinkConfig) sqlTables.get(targetTableName);
SinkConfig sinkConfigNew = new SinkConfig();
sinkConfigNew.setConnector(sinkConfig.getConnector());
sinkConfigNew.setPluginInputIdentifier(pluginOutputIdentifier);
sinkConfigNew.getOptions().addAll(sinkConfig.getOptions());
sinkConfigNew
.getOptions()
.add(Option.of(OPTION_PLUGIN_INPUT_KEY, "\"" + pluginOutputIdentifier + "\""));
seaTunnelConfig.getSinkConfigs().add(sinkConfigNew);
} else {
throw new ParserException("Unsupported syntax: " + insertSql);
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Declare the target with CREATE TABLE t WITH ('connector'=...,'table_type'='sink') before the INSERT
- Ensure the target name matches the INSERT INTO identifier exactly
- If the message shows the source table name, still check the INSERT INTO target table's existence and type — the message text is misleading
Example fix
// before
INSERT INTO sink_t SELECT * FROM src -- sink_t undeclared
// after
CREATE TABLE sink_t WITH ('connector'='console','table_type'='sink');
INSERT INTO sink_t SELECT * FROM src Defensive patterns
Strategy: validation
Validate before calling
// before the INSERT, check the INSERT INTO target is declared as a sink
if (!declaredTables.containsKey(targetTable)
|| !"sink".equalsIgnoreCase(declaredTables.get(targetTable).getType())) {
throw new IllegalArgumentException("INSERT INTO target " + targetTable + " must be declared as a sink table first");
} Try / catch
try {
SeaTunnelConfig c = SqlConfigBuilder.of(sql);
} catch (ParserException e) {
if (e.getMessage().startsWith("The sink table[")) {
// NOTE: message may print the source name; validate the INSERT INTO target table's declaration/type
}
} Prevention
- Declare the sink table with 'table_type'='sink' before any INSERT INTO it
- Match the INSERT INTO identifier to the declared sink name exactly
- Remember the error message may show the source table name; always inspect the INSERT INTO target when this fires
When it happens
Trigger: INSERT INTO t SELECT ... where t was never declared via CREATE TABLE WITH ('connector'=...), or t was declared as a source/transform rather than a sink.
Common situations: Forgetting the sink CREATE TABLE before the INSERT; declaring the target without 'table_type'='sink'; mistyped target name; confusion caused by the error message showing the wrong table name.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- The source table[%s] is not found
- Insert sql must not have columns
- Insert sql must have select statement
- Source table must be specified in SQL: <insertSql>
- Unsupported syntax: <insertSql>
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/5eaac1b03b28d83f.
Report an issue: GitHub.