apache/iceberg · error · UnsupportedOperationException

Unsupported type: ${primitive}

Error message

Unsupported type: ${primitive}

What it means

In FlinkParquetWriters.primitive(), when a primitive column has no logical type annotation, the code switches on the Parquet physical primitive type; unknown types fall to this default and throw UnsupportedOperationException. It means the physical Parquet type is not one of the supported mappings (boolean, int, long, float, double, etc.).

Source

Thrown at flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java:191

        }
      }

      switch (primitive.getPrimitiveTypeName()) {
        case FIXED_LEN_BYTE_ARRAY:
        case BINARY:
          return byteArrays(desc);
        case BOOLEAN:
          return ParquetValueWriters.booleans(desc);
        case INT32:
          return ints(fType, desc);
        case INT64:
          return ParquetValueWriters.longs(desc);
        case FLOAT:
          return ParquetValueWriters.floats(desc);
        case DOUBLE:
          return ParquetValueWriters.doubles(desc);
        default:
          throw new UnsupportedOperationException("Unsupported type: " + primitive);
      }
    }
  }

  private static class LogicalTypeWriterBuilder
      implements LogicalTypeAnnotationVisitor<ParquetValueWriter<?>> {
    private final LogicalType flinkType;
    private final ColumnDescriptor desc;

    private LogicalTypeWriterBuilder(LogicalType flinkType, ColumnDescriptor desc) {
      this.flinkType = flinkType;
      this.desc = desc;
    }

    @Override
    public Optional<ParquetValueWriter<?>> visit(StringLogicalTypeAnnotation strings) {
      return Optional.of(strings(desc));
    }

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Inspect the Parquet schema (parquet-tools/schema) and add or rely on a logical type annotation for FIXED_LEN_BYTE_ARRAY columns (decimal or uuid).
  2. Rewrite the source data so all unannotated columns use supported physical types (boolean, int32, int64, float, double, binary).
  3. Upgrade Iceberg to a version whose FlinkParquetWriters covers the physical type in question.
  4. Exclude or transform the offending column in the Flink pipeline before writing.

Example fix

// before: parquet schema has `required fixed_len_byte_array(16) id;` with no annotation
// after: writer adds a logical annotation so a writer can be produced
// Schema: required fixed_len_byte_array(16) id (UUID)
// or cast the column to binary/string in the upstream pipeline
Defensive patterns

Strategy: validation

Validate before calling

PrimitiveType p = desc.getPrimitiveType();
Set<PrimitiveTypeName> supported = Set.of(BOOLEAN, INT32, INT64, FLOAT, DOUBLE, BINARY, FIXED_LEN_BYTE_ARRAY);
if (!supported.contains(p.getPrimitiveTypeName())) throw new IllegalArgumentException("unsupported " + p);

Try / catch

try {
  reader = FlinkParquetReaders.readBuilder(schema, projectedSchema).build();
} catch (UnsupportedOperationException e) {
  if (e.getMessage().startsWith("Unsupported type:")) {
    // fall back to a generic engine or transform the column
  }
}

Prevention

When it happens

Trigger: Encountering a Parquet primitive of a physical type with no case in the switch, e.g. FIXED_LEN_BYTE_ARRAY without a logical annotation, or newer physical types from files written by other engines.

Common situations: Parquet files produced by external systems using fixed_len_byte_array without a decimal/uuid annotation; corrupted or hand-crafted schemas; using an older Iceberg build that lacks a mapping for a newer type.

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/9811578ac7b3c7de. Report an issue: GitHub.