{"record":{"id":"18bb199384ed8226","repo":"apache/seatunnel","slug":"jdbcconnectorerrorcode-dont-support-sink","errorCode":"JdbcConnectorErrorCode.DONT_SUPPORT_SINK","errorMessage":"The Presto jdbc connector don't support sink","messagePattern":"The Presto jdbc connector don't support sink","errorType":"error_code","errorClass":"JdbcConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/presto/PrestoJdbcRowConverter.java","lineNumber":43,"sourceCode":"import org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.DatabaseIdentifier;\n\nimport javax.annotation.Nullable;\n\nimport java.sql.PreparedStatement;\n\npublic class PrestoJdbcRowConverter extends AbstractJdbcRowConverter {\n    @Override\n    public String converterName() {\n        return DatabaseIdentifier.PRESTO;\n    }\n\n    @Override\n    public PreparedStatement toExternal(\n            TableSchema tableSchema,\n            @Nullable TableSchema databaseTableSchema,\n            SeaTunnelRow row,\n            PreparedStatement statement) {\n        throw new JdbcConnectorException(\n                JdbcConnectorErrorCode.DONT_SUPPORT_SINK,\n                \"The Presto jdbc connector don't support sink\");\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":48,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/presto/PrestoJdbcRowConverter.java#L25-L48","documentation":"PrestoJdbcRowConverter.toExternal unconditionally throws JdbcConnectorException with DONT_SUPPORT_SINK: the Presto JDBC dialect only implements reading (source), not writing. Any attempt to use Presto as a SeaTunnel sink fails immediately when the converter is asked to bind a row to a PreparedStatement.","triggerScenarios":"Configuring a Presto connection as a sink; any sink write path that calls toExternal on a Presto RowConverter, including auto table creation or data writing.","commonSituations":"Users assume any JDBC dialect works bidirectionally and configure Presto as a sink to persist data; accidentally selecting the Presto dialect for a Trino/DB that should be a sink.","solutions":["Use a database that supports JDBC sink (e.g. MySQL, PostgreSQL) instead of Presto for the sink side","Keep Presto as a source only and write results to a real sink connector","If the backend is actually Trino, check whether a Trino-specific dialect/sink support exists in your SeaTunnel version and upgrade if added"],"exampleFix":"// before\nPresto {\n  url = \"jdbc:presto://...\"\n}\nSink {\n  ... // uses Presto dialect -> throws\n}\n// after\nPresto {\n  url = \"jdbc:presto://...\"\n} # source only\nMysql {\n  url = \"jdbc:mysql://...\"\n} # sink target","handlingStrategy":"validation","validationCode":"if (dialectName.equals(\"presto\") && isSinkConnector) {\n    throw new IllegalArgumentException(\"Presto dialect cannot be used as a sink\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    sinkWriter.write(row);\n} catch (JdbcConnectorException e) {\n    if (e.getJdbcConnectorErrorCode() == JdbcConnectorErrorCode.DONT_SUPPORT_SINK) {\n        // switch sink connector\n    }\n}","preventionTips":["Check dialect source/sink support matrix before designing pipelines","Use Presto/Trino only as sources; persist to a real database sink","Validate connector direction capability at job-planning time"],"tags":["jdbc","presto","sink","unsupported"],"backgroundTag":"operation-not-supported","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"}