apache/seatunnel · error · HiveConnectorException
ILLEGAL_ARGUMENT
ILLEGAL_ARGUMENT
Error message
Hive connector only support [text parquet orc] table now
What it means
HiveSourceConfig only knows how to build a catalog table for TEXT, PARQUET, and ORC file formats. When the resolved FileFormat is anything else (e.g. Avro, SequenceFile, RCFile, or unknown), the switch's default branch throws ILLEGAL_ARGUMENT.
Source
Thrown at seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/source/config/HiveSourceConfig.java:308
private CatalogTable parseCatalogTable(
ReadonlyConfig readonlyConfig,
ReadStrategy readStrategy,
FileFormat fileFormat,
HadoopConf hadoopConf,
List<String> filePaths,
Table table) {
if (CollectionUtils.isEmpty(filePaths)) {
return handleEmptyFilesFallback(readonlyConfig, table);
}
switch (fileFormat) {
case PARQUET:
case ORC:
return parseCatalogTableFromRemotePath(
readonlyConfig, hadoopConf, filePaths, table);
case TEXT:
return parseCatalogTableFromTable(readonlyConfig, readStrategy, table);
default:
throw new HiveConnectorException(
CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,
"Hive connector only support [text parquet orc] table now");
}
}
private static CatalogTable handleEmptyFilesFallback(
ReadonlyConfig readonlyConfig, Table table) {
// Keep a stable schema even when directory is empty.
return buildCatalogTableFromHiveMeta(readonlyConfig, table);
}
private CatalogTable parseCatalogTableFromRemotePath(
ReadonlyConfig readonlyConfig,
HadoopConf hadoopConf,
List<String> filePaths,
Table table) {
CatalogTable catalogTable = buildEmptyCatalogTable(readonlyConfig, table);
try {View on GitHub (pinned to cf67b549a7)
Solutions
- Convert the table to a supported format (e.g. CTAS: `CREATE TABLE t_orc STORED AS ORC AS SELECT * FROM t_avro`) and read that
- If the files are actually text/parquet/orc but detected differently, explicitly set `file_format_type = "<correct type>"` in the source config
- Check the table's `inputFormat`/storage handler via `DESCRIBE FORMATTED` to confirm the actual format
- If the target format is required, use a different connector or extend the read strategy
Example fix
// before
source {
Hive {
file_format_type = "avro"
...
}
}
// after
source {
Hive {
file_format_type = "orc" // supported: text | parquet | orc
...
}
} Defensive patterns
Strategy: validation
Validate before calling
// Check the storage format before configuring the source
List<String> supported = Arrays.asList("text", "parquet", "orc");
String fmt = config.getOptional(HiveSourceOptions.FILE_FORMAT_TYPE)
.orElse("parquet").toLowerCase();
if (!supported.contains(fmt)) {
throw new IllegalArgumentException(
"file_format_type '" + fmt + "' unsupported; use one of " + supported);
} Type guard
boolean isSupportedFormat(String fmt) {
return fmt != null
&& (fmt.equalsIgnoreCase("text")
|| fmt.equalsIgnoreCase("parquet")
|| fmt.equalsIgnoreCase("orc"));
} Try / catch
try {
// ... start Hive source
} catch (org.apache.seatunnel.connectors.seatunnel.hive.exception.HiveConnectorException e) {
if ("ILLEGAL_ARGUMENT".equals(e.getSeaTunnelErrorCode().getCode())
&& e.getMessage().contains("only support [text parquet orc]")) {
throw new IllegalStateException(
"Unsupported Hive table format; convert to orc/parquet/text first", e);
}
throw e;
} Prevention
- Run DESCRIBE FORMATTED to check the table's INPUTFORMAT before reading
- Convert Avro/SequenceFile/RCFile tables to ORC or Parquet for SeaTunnel reads
- Explicitly set file_format_type in the config instead of relying on detection
- Keep read tables in a controlled, supported storage format
When it happens
Trigger: parseCatalogTable() receives a fileFormat outside {PARQUET, ORC, TEXT} — i.e. the Hive table's underlying data files (per configured table_names / file_format_type resolution) are in an unsupported storage format such as Avro, RCFile, SequenceFile, or an empty/unknown format.
Common situations: Pointing the Hive source at tables written by other engines in Avro or SequenceFile; a table whose file extension doesn't map to text/parquet/orc; setting file_format_type to an unsupported value in the SeaTunnel config.
Related errors
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/4e5c206fe3c651f6.
Report an issue: GitHub.