apache/seatunnel · error · UnsupportedOperationException

Can't create JdbcDialect without compatible mode for Hive

Error message

Can't create JdbcDialect without compatible mode for Hive

What it means

HiveDialectFactory.create() throws UnsupportedOperationException because the Hive dialect requires a compatible mode (e.g. 'inceptor'). Only the create(compatibleMode, fieldId) overload is supported for jdbc:hive2: URLs.

Solutions

  1. Set compatible_mode = "inceptor" (or the supported mode) in the Hive JDBC sink/source config so the two-arg create() is used.
  2. If plain HiveServer2 is needed without a compatible mode, use a different dialect/URL scheme.
  3. Upgrade or patch the calling code to pass a compatible mode to the factory.

Example fix

// before
sink = { url = "jdbc:hive2://host:10000/db" }
// after
sink = { url = "jdbc:hive2://host:10000/db", compatible_mode = "inceptor" }
Defensive patterns

Strategy: type-guard

Validate before calling

if (url.startsWith("jdbc:hive2:") && compatibleMode == null) { throw new IllegalArgumentException("Hive dialect requires compatible_mode (e.g. inceptor)"); }

Type guard

JdbcDialect safeCreate(JdbcDialectFactory f, String mode, String fieldId) { return f instanceof HiveDialectFactory ? f.create(mode, fieldId) : f.create(); }

Try / catch

try { dialect = factory.create(); } catch (UnsupportedOperationException e) { dialect = factory.create(compatibleMode, fieldId); }

Prevention

When it happens

Trigger: A jdbc:hive2: URL resolves to HiveDialectFactory and the framework calls the no-arg create() method.

Common situations: Hive connector config missing the compatible_mode option; framework versions that default to the no-arg factory; users expecting plain HiveServer2 support without specifying a mode.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

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

import com.google.auto.service.AutoService;

/** Factory for {@link HiveDialect}. */
@AutoService(JdbcDialectFactory.class)
public class HiveDialectFactory implements JdbcDialectFactory {

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

    @Override
    public boolean acceptsURL(String url) {
        return url.startsWith("jdbc:hive2:");
    }

    @Override
    public JdbcDialect create() {
        throw new UnsupportedOperationException(
                "Can't create JdbcDialect without compatible mode for Hive");
    }

    @Override
    public JdbcDialect create(String compatibleMode, String fieldId) {
        if ("inceptor".equals(compatibleMode)) {
            return new InceptorDialect();
        }
        return new HiveDialect();
    }
}

View on GitHub (pinned to cf67b549a7)