apache/iceberg · error · IllegalArgumentException
Invalid iceberg type %s corresponding to ORC type %s
Error message
Invalid iceberg type %s corresponding to ORC type %s
What it means
FlinkOrcReader maps Iceberg primitive types to ORC value readers. When an Iceberg primitive has no ORC reader implementation in the switch, it throws IllegalArgumentException 'Invalid iceberg type %s corresponding to ORC type %s', naming both the Iceberg type and the ORC type it failed to map.
Source
Thrown at flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkOrcReader.java:132
}
case TIMESTAMP_NANO:
Types.TimestampNanoType timestampNanoType = (Types.TimestampNanoType) iPrimitive;
if (timestampNanoType.shouldAdjustToUTC()) {
return FlinkOrcReaders.timestampTzs();
} else {
return FlinkOrcReaders.timestamps();
}
case STRING:
return FlinkOrcReaders.strings();
case UUID:
case FIXED:
case BINARY:
return OrcValueReaders.bytes();
case DECIMAL:
Types.DecimalType decimalType = (Types.DecimalType) iPrimitive;
return FlinkOrcReaders.decimals(decimalType.precision(), decimalType.scale());
default:
throw new IllegalArgumentException(
String.format(
"Invalid iceberg type %s corresponding to ORC type %s", iPrimitive, primitive));
}
}
}
}
View on GitHub (pinned to 86d9c8fc54)
Solutions
- Upgrade iceberg-flink to a version supporting the type
- Exclude the unsupported column from the projection (select only supported columns)
- Convert the table's data files to a format (e.g. Parquet) that supports the type
Example fix
// before
scan.select("nano_ts_col") on ORC files -> throws
// after
scan.select("supported_cols_only") or upgrade the connector Defensive patterns
Strategy: validation
Validate before calling
schema.columns().forEach(f -> { if (f.type().isPrimitiveType()) checkOrcReaderSupported(f.type().asPrimitiveType()); }); Try / catch
try { read(scan); } catch (IllegalArgumentException e) { LOG.error("ORC read failed: {}", e.getMessage()); throw e; } Prevention
- Keep connector versions current
- Restrict projections to supported columns
- Prefer Parquet for newer type features
When it happens
Trigger: Reading ORC data files whose Iceberg schema contains a primitive the ORC reader path does not support.
Common situations: Tables written by newer Iceberg versions with types unsupported by the pinned Flink ORC integration; version skew between modules; unusual column types in ORC-backed tables.
Understand the failure class
Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.
Related errors
- Invalid iceberg type %s corresponding to Flink logical type
- Unsupported YearMonthIntervalType.
- Unsupported DayTimeIntervalType.
- Unsupported DistinctType.
- Unsupported StructuredType.
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/8c20f6df18c2fcd3.
Report an issue: GitHub.