apache/iceberg · error · UnsupportedOperationException

Unsupported type: " + type

Error message

Unsupported type: " + type

What it means

AvroToRowDataConverters.createConverter maps Flink logical types to Avro-to-RowData converters. For TIMESTAMP_WITH_LOCAL_TIME_ZONE with legacyTimestampMapping=true (the pre-FLIP-278/legacy mapping mode), no converter exists, so it throws UnsupportedOperationException("Unsupported type: " + type). Legacy mode does not support local-zoned timestamp conversion from Avro.

Source

Thrown at flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/formats/avro/AvroToRowDataConverters.java:139

        return avroObject -> ((Integer) avroObject).shortValue();
      case BOOLEAN: // boolean
      case INTEGER: // int
      case INTERVAL_YEAR_MONTH: // long
      case BIGINT: // long
      case INTERVAL_DAY_TIME: // long
      case FLOAT: // float
      case DOUBLE: // double
        return avroObject -> avroObject;
      case DATE:
        return AvroToRowDataConverters::convertToDate;
      case TIME_WITHOUT_TIME_ZONE:
        return AvroToRowDataConverters::convertToTime;
      case TIMESTAMP_WITHOUT_TIME_ZONE:
        // Iceberg: Added support for nanoseconds precision (FLINK-39251)
        return avroObject -> convertToTimestamp(avroObject, type);
      case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
        if (legacyTimestampMapping) {
          throw new UnsupportedOperationException("Unsupported type: " + type);
        } else {
          // Iceberg: Added support for nanoseconds precision (FLINK-39251)
          return avroObject -> convertToTimestamp(avroObject, type);
        }
      case CHAR:
      case VARCHAR:
        return avroObject -> StringData.fromString(avroObject.toString());
      case BINARY:
      case VARBINARY:
        return AvroToRowDataConverters::convertToBytes;
      case DECIMAL:
        return createDecimalConverter((DecimalType) type);
      case ARRAY:
        return createArrayConverter((ArrayType) type, legacyTimestampMapping);
      case ROW:
        return createRowConverter((RowType) type);
      case MAP:
      case MULTISET:

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Disable legacy timestamp mapping (set the mapping option to the non-legacy value, e.g. 'timestamp_mapping' table option to from-legacy=false / remove legacy config).
  2. Change the field type from TIMESTAMP_WITH_LOCAL_TIME_ZONE to TIMESTAMP_WITHOUT_TIME_ZONE if UTC-less semantics are acceptable.
  3. Pre-convert the Avro field to a supported logical type before reading.

Example fix

// before
table.option("table.local-time-zone", ...); // legacy timestamp mapping enabled
// after
// remove legacy mapping option so TIMESTAMP_WITH_LOCAL_TIME_ZONE is supported
DynamicTableSink sink = ... // no legacy timestamp option
Defensive patterns

Strategy: validation

Validate before calling

// before reading, check the format/table options
boolean legacy = options.get("table.local-time-zone-legacy") != null; // or the legacy mapping option
if (legacy && schema.getFieldCount(...) instanceof TimestampType(false, _)) { throw new ConfigException("Disable legacy timestamp mapping to read TIMESTAMP_WITH_LOCAL_TIME_ZONE"); }

Try / catch

try { RowData row = converter.convert(avroRecord); } catch (UnsupportedOperationException e) { /* reconfigure legacy mapping or remap the field */ }

Prevention

When it happens

Trigger: Reading Avro data into RowData whose schema contains a TIMESTAMP_WITH_LOCAL_TIME_ZONE field while the connector/format is configured with legacy timestamp mapping enabled (e.g. table option 'format' with legacy timestamp mapping, or table.local-time-zone legacy mode).

Common situations: Upgraded Flink jobs that still set the legacy timestamp mapping option; tables created with older Iceberg/Flink options that force legacy mode; Avro files containing instants being read through a legacy-configured format.

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