apache/iceberg · error · java.lang.UnsupportedOperationException

Unsupported type: %s

Error message

Unsupported type: %s

What it means

FlinkParquetWriters.primitive() throws UnsupportedOperationException 'Unsupported type: <primitive>' when the Parquet physical primitive type has no writer branch in the final switch — the physical type cannot be mapped to a ParquetValueWriter for the expected Flink/Iceberg value.

Source

Thrown at flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java:213

        }
      }

      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. Identify the physical type from the message and retype the column to a supported type.
  2. Use another file format (ORC/Avro) if the type mapping exists there.
  3. Upgrade iceberg-flink to a version with broader physical type support.
  4. Adjust the write pipeline so the parquet physical type matches the Iceberg type mapping.

Example fix

// before
// physical type unsupported by Flink writer switch
// after
// map column to BINARY/STRING standard physical type or switch format
Defensive patterns

Strategy: validation

Validate before calling

schema.columns().forEach(c -> {
  Type.TypeID id = c.type().typeId();
  Preconditions.checkArgument(id != Type.TypeID.UNKNOWN,
      "Type %s has no supported Parquet physical mapping", c.type());
});

Type guard

boolean parquetWritable(Type.TypeID id) {
  switch (id) {
    case BOOLEAN: case INTEGER: case LONG: case FLOAT: case DOUBLE:
    case STRING: case BINARY: case FIXED: case DATE:
    case TIMESTAMP: case DECIMAL:
      return true;
    default:
      return false;
  }
}

Try / catch

try {
  writer.write(row);
} catch (UnsupportedOperationException e) {
  if (e.getMessage().startsWith("Unsupported type")) {
    LOG.error("Parquet writer cannot handle physical type: {}", e.getMessage());
  }
  throw e;
}

Prevention

When it happens

Trigger: Writing Parquet where a column's physical type (per the message-writer mapping, e.g. unexpected FIXED_LEN_BYTE_ARRAY usage or missing mapping) isn't one of the supported branches (BOOLEAN, INT32, INT64, FLOAT, DOUBLE, BINARY, etc.).

Common situations: Mismatch between the message/parquet type mapping and the actual primitive; unsupported physical encodings introduced by custom writers.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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