apache/iceberg · error · IllegalArgumentException

Unsupported Avro type ''.'

Error message

Unsupported Avro type ''.'

What it means

Thrown when AvroSchemaConverter.convertToTypeInfo encounters an Avro schema type that has no mapping to a Flink TypeInformation in its switch statement. Only primitive types (DOUBLE, BOOLEAN, NULL, etc.) plus mapped complex types are supported; anything outside the handled cases hits this exception. It is a fall-through guard for unsupported or unrecognized Avro types.

Solutions

  1. Check which Avro type in the schema is unsupported (from the message and schema).
  2. Switch to AvroSchemaConverter.convertToDataType, which supports a broader set of types.
  3. Flatten or simplify the schema (e.g. unwrap unions) before conversion.
  4. Upgrade the Flink/Iceberg version if the type was added in a newer Avro spec.

Example fix

// before
TypeInformation<Row> ti = AvroSchemaConverter.convertToTypeInfo(schemaString, true);
// after
DataType dt = AvroSchemaConverter.convertToDataType(schemaString, true); // broader type support
Defensive patterns

Strategy: validation

Validate before calling

if (schema.getType() == Schema.Type.UNION) { /* ensure only [null, T] */ } else if (!Set.of("RECORD","ENUM","ARRAY","MAP","FIXED","STRING","BOOLEAN","INT","LONG","FLOAT","DOUBLE","NULL","BYTES").contains(schema.getType().name())) throw ...

Prevention

When it happens

Trigger: Calling convertToTypeInfo with a Schema whose getType() is a case not handled by the converter (e.g. exotic named types, RECORD/ARRAY/MAP/UNION handled on other branches but falling through when nested unexpectedly, or Avro types added in newer Avro versions).

Common situations: Using Avro logical types or record structures that the legacy TypeInformation-based converter does not support; users typically need the DataType-based API (convertToDataType) instead.

Related errors


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

Appendix: source

Thrown at flink/v2.3/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 &amp; 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 &amp; SQL API.
   *
   * @param avroSchemaString Avro schema definition string

View on GitHub (pinned to 86d9c8fc54)