apache/iceberg · error · UnsupportedOperationException

Unsupported type: ${primitive}

Error message

Unsupported type: ${primitive}

What it means

FlinkParquetReaders maps Parquet primitive column descriptors to Iceberg/Flink value readers. If the Parquet physical type has no reader implementation in the switch, it throws UnsupportedOperationException 'Unsupported type'. Only a fixed set of Parquet physical types is handled.

Source

Thrown at flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetReaders.java:325

          return new ParquetValueReaders.ByteArrayReader(desc);
        case INT32:
          if (expected.typeId() == org.apache.iceberg.types.Type.TypeID.LONG) {
            return new ParquetValueReaders.IntAsLongReader(desc);
          } else {
            return new ParquetValueReaders.UnboxedReader<>(desc);
          }
        case FLOAT:
          if (expected.typeId() == org.apache.iceberg.types.Type.TypeID.DOUBLE) {
            return new ParquetValueReaders.FloatAsDoubleReader(desc);
          } else {
            return new ParquetValueReaders.UnboxedReader<>(desc);
          }
        case BOOLEAN:
        case INT64:
        case DOUBLE:
          return new ParquetValueReaders.UnboxedReader<>(desc);
        default:
          throw new UnsupportedOperationException("Unsupported type: " + primitive);
      }
    }
  }

  private static class BinaryDecimalReader
      extends ParquetValueReaders.PrimitiveReader<DecimalData> {
    private final int precision;
    private final int scale;

    BinaryDecimalReader(ColumnDescriptor desc, int precision, int scale) {
      super(desc);
      this.precision = precision;
      this.scale = scale;
    }

    @Override
    public DecimalData read(DecimalData ignored) {
      Binary binary = column.nextBinary();

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Rewrite the Parquet files with supported physical types (e.g. convert INT96 to INT64 timestamps)
  2. Upgrade iceberg-flink/iceberg-parquet to a version with broader type support
  3. Read the offending columns with a different engine or exclude them from the projection

Example fix

// before
hive.write.parquet(INT96 timestamps) -> FlinkParquetReaders throws
// after
rewrite data with INT64 millis timestamps before reading via iceberg-flink
Defensive patterns

Strategy: validation

Validate before calling

for (ColumnDescriptor d : parquetSchema.getColumns()) checkParquetTypeSupported(d.getPrimitive());

Try / catch

try { read(scan); } catch (UnsupportedOperationException e) { LOG.error("Parquet read failed: {}", e.getMessage()); throw e; }

Prevention

When it happens

Trigger: Reading Parquet data files containing a physical type (e.g. legacy INT96 or an unrecognized type) not covered by the reader's switch.

Common situations: Parquet files written by foreign tools with legacy physical types (e.g. Hive INT96 timestamps); version skew between iceberg-parquet and iceberg-flink; corrupted file schemas.

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


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/5b39a13179eb8b19. Report an issue: GitHub.