apache/seatunnel · error · HiveConnectorException

COMMON_ILLEGAL_ARGUMENT

COMMON_ILLEGAL_ARGUMENT

Error message

Hive connector only support [text parquet orc] table now

What it means

HiveTableUtils.parseFileFormat maps a Hive table's `inputFormat` class name to a SeaTunnel FileFormat. Only text (TextInputFormat), parquet (MapredParquetInputFormat), and orc (OrcInputFormat) are supported; any other input format (e.g. Avro, SequenceFile, RCFile) is rejected as an illegal argument.

Source

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

        }
        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;
        }
        throw new HiveConnectorException(
                CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,
                "Hive connector only support [text parquet orc] table now");
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Recreate the Hive table (or a copy) as STORED AS PARQUET, ORC, or TEXTFILE so the connector can process it.
  2. Use a different SeaTunnel connector that supports the table's actual file format (e.g. the Avro/file connectors reading the underlying path directly).
  3. Verify the table's `input_format` in the metastore (DESC FORMATTED) — a custom/legacy InputFormat class name will never match the supported constants.

Example fix

-- before
CREATE TABLE t (...) STORED AS AVRO;
-- after
CREATE TABLE t (...) STORED AS PARQUET;
Defensive patterns

Strategy: validation

Validate before calling

Table hiveTable = HiveTableUtils.getTableInfo(readonlyConfig);
String inputFormat = hiveTable.getSd().getInputFormat();
boolean supported = HiveConstants.TEXT_INPUT_FORMAT_CLASSNAME.equals(inputFormat)
    || HiveConstants.PARQUET_INPUT_FORMAT_CLASSNAME.equals(inputFormat)
    || HiveConstants.ORC_INPUT_FORMAT_CLASSNAME.equals(inputFormat);
if (!supported) {
    throw new IllegalArgumentException("Unsupported Hive input format: " + inputFormat);
}

Try / catch

try {
    FileFormat fmt = HiveTableUtils.parseFileFormat(inputFormat);
} catch (HiveConnectorException e) {
    // surface the raw inputFormat value and list supported formats
    throw e;
}

Prevention

When it happens

Trigger: Calling parseFileFormat with an inputFormat string that matches none of HiveConstants' TEXT/PARQUET/ORC input format classnames — typically the input format read from the Hive metastore Table object of the configured source/sink table.

Common situations: The Hive table was created STORED AS AVRO, SEQUENCEFILE, RCFILE, or with a custom InputFormat; the table is a managed table backed by a format SeaTunnel's Hive connector cannot read/write.

Related errors


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