apache/seatunnel · error · DebeziumException

Unable to parse unsupported LOB_WRITE SQL

Error message

Unable to parse unsupported LOB_WRITE SQL: ${sql}

What it means

LOB_WRITE redo statements must match a known textual pattern (LOB_WRITE_SQL_PATTERN) from which the connector extracts the written data. When the SQL doesn't match — LogMiner emitted a LOB_WRITE form the regex doesn't recognize — parseLobWrite (in the LOB parsing path of AbstractLogMinerEventProcessor) throws this DebeziumException rather than silently corrupting the event.

Solutions

  1. Upgrade the Debezium connector version bundled with SeaTunnel — LOB_WRITE pattern handling is expanded across releases.
  2. Avoid piecewise/dynamic LOB writes if possible; write LOB values in single statements that produce standard LOB_WRITE SQL.
  3. Enable incremental snapshot /LOB-aware settings compatible with your Oracle version, or upgrade the Oracle JDBC driver to match.
  4. Capture the failing SQL and report it (Debezium Jira) so the pattern can be extended.

Example fix

null
Defensive patterns

Strategy: try-catch

Try / catch

try {
    parsed = parseLobWrite(sql);
} catch (DebeziumException e) {
    if (e.getMessage().startsWith("Unable to parse unsupported LOB_WRITE SQL")) {
        LOGGER.warn("Unrecognized LOB_WRITE format, skipping: {}", sql);
    } else { throw e; }
}

Prevention

When it happens

Trigger: Parsing a LOB_WRITE operation's SQL string (row.getSql()) when it is non-null but does not match LOB_WRITE_SQL_PATTERN.matches() — e.g. a differently formatted BEGIN_DATA/END_DATA payload from another Oracle version or a truncated/concatenated LOB fragment.

Common situations: Oracle version producing a LOB_WRITE syntax variant the embedded Debezium/SeaTunnel version doesn't know; extremely large LOB writes split in unexpected ways; interactive LOB (piecewise) operations with unusual chunk formats; connector version lagging behind the Oracle server version.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/c7693dfe8ba82646. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/io/debezium/connector/oracle/logminer/processor/AbstractLogMinerEventProcessor.java:1125

    private static Pattern LOB_WRITE_SQL_PATTERN =
            Pattern.compile(
                    "(?s).* := ((?:HEXTORAW\\()?'.*'(?:\\))?);\\s*dbms_lob.write\\([^,]+,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,[^,]+\\);.*");

    /**
     * Parses a {@code LOB_WRITE} operation SQL fragment.
     *
     * @param sql sql statement
     * @return the parsed statement
     * @throws DebeziumException if an unexpected SQL fragment is provided that cannot be parsed
     */
    private ParsedLobWriteSql parseLobWriteSql(String sql) {
        if (sql == null) {
            return null;
        }

        Matcher m = LOB_WRITE_SQL_PATTERN.matcher(sql.trim());
        if (!m.matches()) {
            throw new DebeziumException("Unable to parse unsupported LOB_WRITE SQL: " + sql);
        }

        String data = m.group(1);
        if (data.startsWith("'")) {
            // string data; drop the quotes
            data = data.substring(1, data.length() - 1);
        }
        int length = Integer.parseInt(m.group(2));
        int offset = Integer.parseInt(m.group(3)) - 1; // Oracle uses 1-based offsets
        return new ParsedLobWriteSql(offset, length, data);
    }

    private class ParsedLobWriteSql {
        final int offset;
        final int length;
        final String data;

        ParsedLobWriteSql(int _offset, int _length, String _data) {

View on GitHub (pinned to cf67b549a7)