apache/seatunnel · error · HiveConnectorException

ILLEGAL_ARGUMENT

ILLEGAL_ARGUMENT

Error message

Hive connector only support [text parquet orc] table now

What it means

Hive sink only supports tables stored in text, parquet, or orc file formats. When the target Hive table's storage format (or the configured file_format_type) resolves to anything else — e.g. avro, sequencefile, rcfile — HiveSink's generateFileSinkConfig hits the default branch of its format switch and throws this error during sink initialization.

Source

Thrown at seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/sink/HiveSink.java:199

                                .withValue(
                                        ROW_DELIMITER.key(),
                                        ConfigValueFactory.fromAnyRef(
                                                parameters.get("line.delim")));
                break;
            case PARQUET:
                pluginConfig =
                        pluginConfig.withValue(
                                FILE_FORMAT_TYPE.key(),
                                ConfigValueFactory.fromAnyRef(FileFormat.PARQUET.toString()));
                break;
            case ORC:
                pluginConfig =
                        pluginConfig.withValue(
                                FILE_FORMAT_TYPE.key(),
                                ConfigValueFactory.fromAnyRef(FileFormat.ORC.toString()));
                break;
            default:
                throw new HiveConnectorException(
                        CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,
                        "Hive connector only support [text parquet orc] table now");
        }
        pluginConfig =
                pluginConfig
                        .withValue(
                                IS_PARTITION_FIELD_WRITE_IN_FILE.key(),
                                ConfigValueFactory.fromAnyRef(false))
                        .withValue(
                                FILE_PATH.key(),
                                ConfigValueFactory.fromAnyRef(
                                        tableInformation.getSd().getLocation()))
                        .withValue(SINK_COLUMNS.key(), ConfigValueFactory.fromAnyRef(sinkFields))
                        .withValue(
                                PARTITION_BY.key(), ConfigValueFactory.fromAnyRef(partitionKeys));
        // Only set a default file_name_expression when it's not provided by user config.
        if (!pluginConfig.hasPath(FILE_NAME_EXPRESSION.key())) {
            pluginConfig =

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the Hive table's DDL and confirm it uses STORED AS TEXTFILE, PARQUET, or ORC
  2. If the table is in another format, create a staging table in parquet/orc and write to that instead
  3. Explicitly set file_format_type = "parquet" (or orc/text) in the sink plugin config
  4. Verify the table_name in the config points to the intended table, not one with an exotic format

Example fix

// before
sink {
  Hive {
    table_name = "db.avro_table"
  }
}
// after
sink {
  Hive {
    table_name = "db.parquet_staging_table"
    file_format_type = "parquet"
  }
}
Defensive patterns

Strategy: validation

Validate before calling

// Before submitting, check the table format:
// beeline> DESCRIBE FORMATTED db.table;  -> InputFormat must map to TextFile/Parquet/ORC
String fmt = sinkOptions.get(FILE_FORMAT_TYPE); // or inferred from table
boolean ok = fmt == null || List.of("text","parquet","orc").contains(fmt.toLowerCase());
if (!ok) throw new IllegalArgumentException("file_format_type must be text, parquet or orc: " + fmt);

Try / catch

try {
    hiveSink = new HiveSink(pluginConfig);
} catch (HiveConnectorException e) {
    if (e.getCode().equals(CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT)) {
        // fall back to a parquet staging table or surface a clear config error
    }
}

Prevention

When it happens

Trigger: Creating a Hive sink whose table's StorageDescriptor input/output format maps to an unsupported FileFormat, or explicitly setting file_format_type to a value outside text/parquet/orc in the sink config.

Common situations: Pointing the sink at a Hive table created with STORED AS AVRO or SEQUENCEFILE; typo in file_format_type; table created with a custom SerDe whose format cannot be inferred.

Related errors


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