apache/seatunnel · error · JdbcConnectorException

DONT_SUPPORT_SINK

DONT_SUPPORT_SINK

Error message

The Hive jdbc connector don't support sink

What it means

HiveJdbcRowConverter.toExternal is the write-path (sink) converter for the Hive dialect, and Hive over JDBC is read-only in this connector; any attempt to write rows throws JdbcConnectorException with DONT_SUPPORT_SINK.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/hive/HiveJdbcRowConverter.java:44

import javax.annotation.Nullable;

import java.sql.PreparedStatement;

public class HiveJdbcRowConverter extends AbstractJdbcRowConverter {

    @Override
    public String converterName() {
        return DatabaseIdentifier.HIVE;
    }

    @Override
    public PreparedStatement toExternal(
            TableSchema tableSchema,
            @Nullable TableSchema databaseTableSchema,
            SeaTunnelRow row,
            PreparedStatement statement) {
        throw new JdbcConnectorException(
                JdbcConnectorErrorCode.DONT_SUPPORT_SINK,
                "The Hive jdbc connector don't support sink");
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Use Hive as a Source only; pick a different sink (e.g. HDFS/File connector or a JDBC dialect that supports writes).
  2. If writing to a Hive-backed store is required, write to the underlying table via a supported sink connector instead of the Hive JDBC dialect.
  3. Check dialect capability before configuring pipelines (Hive dialect sink is intentionally unsupported).

Example fix

// before
sink { plugin_name = "Jdbc", url = "jdbc:hive2://host:10000/db", ... }
// after
source { plugin_name = "Jdbc", url = "jdbc:hive2://host:10000/db", ... }
sink { plugin_name = "HdfsFile", ... }
Defensive patterns

Strategy: validation

Validate before calling

if (dialect instanceof HiveDialect && isSink) { throw new IllegalArgumentException("Hive jdbc cannot be used as a sink; use Source only"); }

Type guard

boolean supportsSink(JdbcDialect d) { return !(d instanceof HiveDialect); }

Try / catch

try { sink.write(row); } catch (JdbcConnectorException e) { if (e.getErrorCode() == JdbcConnectorErrorCode.DONT_SUPPORT_SINK) { /* reconfigure pipeline to use a writable sink */ } else throw e; }

Prevention

When it happens

Trigger: Configuring Hive (jdbc:hive2:) as a SeaTunnel Sink so the row converter's toExternal(PreparedStatement) is invoked during writing.

Common situations: Users assume Hive supports INSERT via JDBC the same way as MySQL/Postgres and configure it as a sink; generic JDBC sink templates applied to Hive URLs.

Related errors


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