apache/seatunnel · error · SeaTunnelRuntimeException

HIVE_TABLE_NAME_ERROR

HIVE_TABLE_NAME_ERROR

Error message

Current table name is 

What it means

HiveTableUtils.getTableInfo parses the `table_name` config into a TablePath (database.table). The connector throws HIVE_TABLE_NAME_ERROR when either the database name or table name is missing, meaning the configured table name does not have the required `db.table` form. The connector cannot resolve the Hive metastore table without both parts.

Source

Thrown at seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveTableUtils.java:38

import org.apache.seatunnel.api.configuration.ReadonlyConfig;
import org.apache.seatunnel.api.table.catalog.TablePath;
import org.apache.seatunnel.common.exception.CommonErrorCodeDeprecated;
import org.apache.seatunnel.common.exception.SeaTunnelRuntimeException;
import org.apache.seatunnel.connectors.seatunnel.file.config.FileFormat;
import org.apache.seatunnel.connectors.seatunnel.hive.config.HiveBaseOptions;
import org.apache.seatunnel.connectors.seatunnel.hive.config.HiveConstants;
import org.apache.seatunnel.connectors.seatunnel.hive.exception.HiveConnectorErrorCode;
import org.apache.seatunnel.connectors.seatunnel.hive.exception.HiveConnectorException;

import org.apache.hadoop.hive.metastore.api.Table;

public class HiveTableUtils {

    public static Table getTableInfo(ReadonlyConfig readonlyConfig) {
        String table = readonlyConfig.get(HiveBaseOptions.TABLE_NAME);
        TablePath tablePath = TablePath.of(table);
        if (tablePath.getDatabaseName() == null || tablePath.getTableName() == null) {
            throw new SeaTunnelRuntimeException(
                    HiveConnectorErrorCode.HIVE_TABLE_NAME_ERROR, "Current table name is " + table);
        }
        try (HiveMetaStoreProxy hiveMetaStoreProxy = new HiveMetaStoreProxy(readonlyConfig)) {
            return hiveMetaStoreProxy.getTable(
                    tablePath.getDatabaseName(), tablePath.getTableName());
        }
    }

    public static FileFormat parseFileFormat(Table table) {
        String inputFormat = table.getSd().getInputFormat();
        if (HiveConstants.TEXT_INPUT_FORMAT_CLASSNAME.equals(inputFormat)) {
            return FileFormat.TEXT;
        }
        if (HiveConstants.PARQUET_INPUT_FORMAT_CLASSNAME.equals(inputFormat)) {
            return FileFormat.PARQUET;
        }
        if (HiveConstants.ORC_INPUT_FORMAT_CLASSNAME.equals(inputFormat)) {
            return FileFormat.ORC;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set `table_name` to the fully qualified `database.table` form, e.g. `table_name = "default.my_table"`.
  2. Check the HOCON config for typos, stray quotes, or an unrendered template variable in the table_name value.
  3. If the value is built programmatically, validate it contains exactly one '.' with non-empty parts before calling getTableInfo.

Example fix

// before
table_name = "my_hive_table"
// after
table_name = "default.my_hive_table"
Defensive patterns

Strategy: validation

Validate before calling

String table = readonlyConfig.get(HiveBaseOptions.TABLE_NAME);
String[] parts = table == null ? new String[0] : table.split("\\.");
if (parts.length != 2 || parts[0].isEmpty() || parts[1].isEmpty()) {
    throw new IllegalArgumentException("table_name must be 'database.table', got: " + table);
}

Try / catch

try {
    Table t = HiveTableUtils.getTableInfo(readonlyConfig);
} catch (SeaTunnelRuntimeException e) {
    if (HiveConnectorErrorCode.HIVE_TABLE_NAME_ERROR.equals(e.getErrorCode())) {
        // log config value and fail fast with guidance to use db.table
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling HiveTableUtils.getTableInfo(readonlyConfig) where HiveBaseOptions.TABLE_NAME is null, a bare table name without a database prefix (e.g. "mytable"), or a malformed string like "db." or ".table" that yields a null databaseName or tableName from TablePath.of().

Common situations: User configures `table_name = "my_table"` instead of `"my_db.my_table"` in a Hive source/sink config; a placeholder template value was never substituted; extra/missing quotes or spaces around the value cause the split on '.' to fail.

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/3a213cf0612bb5df. Report an issue: GitHub.