apache/seatunnel · error · UnsupportedOperationException

Can't create JdbcDialect without compatible mode for OceanBa

Error message

Can't create JdbcDialect without compatible mode for OceanBase

What it means

OceanBaseDialectFactory cannot build a dialect without knowing OceanBase's compatibility mode (MySQL vs Oracle). The no-arg create() deliberately throws UnsupportedOperationException because the two modes need entirely different SQL dialects, so a mode must be supplied via create(compatibleMode, fieldIde).

Source

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

import com.google.auto.service.AutoService;

import javax.annotation.Nonnull;

@AutoService(JdbcDialectFactory.class)
public class OceanBaseDialectFactory implements JdbcDialectFactory {
    @Override
    public String dialectFactoryName() {
        return DatabaseIdentifier.OCEANBASE;
    }

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

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

    @Override
    public JdbcDialect create(@Nonnull String compatibleMode, String fieldIde) {
        if ("oracle".equalsIgnoreCase(compatibleMode)) {
            return new OracleDialect();
        }
        return new OceanBaseMysqlDialect();
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set the OceanBase compatible mode in the source/sink config (e.g. compatible_mode = "mysql" or "oracle").
  2. Use the dialect factory overload that takes compatibleMode explicitly.
  3. Confirm the URL is jdbc:oceanbase: and mode matches the actual OceanBase tenant (MySQL or Oracle mode).

Example fix

// before
url = "jdbc:oceanbase://host:2881/db"
// after
url = "jdbc:oceanbase://host:2881/db"
compatible_mode = "mysql"
Defensive patterns

Strategy: validation

Validate before calling

if (url.startsWith("jdbc:oceanbase:") && (compatibleMode == null || compatibleMode.isEmpty())) {
    throw new IllegalArgumentException("OceanBase requires compatible_mode = mysql|oracle");
}

Try / catch

catch (UnsupportedOperationException e) { if (e.getMessage().contains("compatible mode")) { /* add compatible_mode to config and rebuild factory */ } }

Prevention

When it happens

Trigger: The JDBC URL is recognized as jdbc:oceanbase: but dialect resolution falls back to the parameterless factory create() because no compatible-mode config was provided.

Common situations: Using the OceanBase dialect with only a URL and no compatible_mode config key; calling the dialect factory programmatically without a mode; using an older config template predating OceanBase mode support.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


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