apache/iceberg · error · IllegalArgumentException

Unsupported Avro type '" + schema.getType() + "'.

Error message

Unsupported Avro type '" + schema.getType() + "'.

What it means

The convertToTypeInfo(Schema, boolean) overload maps Avro schema types to Flink TypeInformation. Avro types without a Flink mapping (e.g. FIXED, some logical types, or other exotic branches) fall through the switch and trigger IllegalArgumentException('Unsupported Avro type ...').

Source

Thrown at flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/formats/avro/typeutils/AvroSchemaConverter.java:236

              || (schema.getLogicalType() != null
                  && schema.getLogicalType().getName().equals("local-timestamp-nanos"))) {
            return Types.LOCAL_DATE_TIME;
          } else if (schema.getLogicalType() == LogicalTypes.timeMicros()
              || schema.getLogicalType() == LogicalTypes.timeMillis()) {
            return Types.SQL_TIME;
          }
        }
        return Types.LONG;
      case FLOAT:
        return Types.FLOAT;
      case DOUBLE:
        return Types.DOUBLE;
      case BOOLEAN:
        return Types.BOOLEAN;
      case NULL:
        return Types.VOID;
    }
    throw new IllegalArgumentException("Unsupported Avro type '" + schema.getType() + "'.");
  }

  /**
   * Converts an Avro schema string into a nested row structure with deterministic field order and
   * data types that are compatible with Flink's Table & SQL API.
   *
   * @param avroSchemaString Avro schema definition string
   * @return data type matching the schema
   */
  public static DataType convertToDataType(String avroSchemaString) {
    return convertToDataType(avroSchemaString, true);
  }

  /**
   * Converts an Avro schema string into a nested row structure with deterministic field order and
   * data types that are compatible with Flink's Table & SQL API.
   *
   * @param avroSchemaString Avro schema definition string

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Replace FIXED fields with BYTES/STRING in the schema, or use the convertToDataType API which supports more types.
  2. Expand FIXED fields to explicit primitive types before conversion.
  3. Update the library version, which may add mappings for the missing Avro type.
  4. If a mapping is genuinely missing, extend the switch in AvroSchemaConverter to handle the type.

Example fix

// before
{"name":"id","type":{"type":"fixed","size":16,"name":"uuid"}}
// after
{"name":"id","type":"string"}
Defensive patterns

Strategy: validation

Validate before calling

Schema best = new Schema.Parser().parse(schemaString);
Set<Schema.Type> unsupported = Set.of(Schema.Type.FIXED);
if (unsupported.contains(best.getType())) throw new IllegalArgumentException("Unsupported Avro type: " + best.getType());
// also walk record fields recursively

Try / catch

try { convertToTypeInfo(schema, legacy); } catch (IllegalArgumentException e) { /* switch to convertToDataType path or map FIXED->bytes upstream */ }

Prevention

When it happens

Trigger: Calling convertToTypeInfo with a Schema whose root (or nested branch) is an Avro type the switch does not cover, such as FIXED, or a record/array/map branch containing such a type.

Common situations: Schemas containing Avro FIXED for binary data; DECIMAL logical types in TypeInformation path; legacy schemas with unions or enums not supported by the legacy conversion.

Related errors


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