{"record":{"id":"6033631c645844fb","repo":"apache/iceberg","slug":"unsupported-avro-type","errorCode":null,"errorMessage":"Unsupported Avro type ''.'","messagePattern":"Unsupported Avro type ''\\.'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/formats/avro/typeutils/AvroSchemaConverter.java","lineNumber":236,"sourceCode":"              || (schema.getLogicalType() != null\n                  && schema.getLogicalType().getName().equals(\"local-timestamp-nanos\"))) {\n            return Types.LOCAL_DATE_TIME;\n          } else if (schema.getLogicalType() == LogicalTypes.timeMicros()\n              || schema.getLogicalType() == LogicalTypes.timeMillis()) {\n            return Types.SQL_TIME;\n          }\n        }\n        return Types.LONG;\n      case FLOAT:\n        return Types.FLOAT;\n      case DOUBLE:\n        return Types.DOUBLE;\n      case BOOLEAN:\n        return Types.BOOLEAN;\n      case NULL:\n        return Types.VOID;\n    }\n    throw new IllegalArgumentException(\"Unsupported Avro type '\" + schema.getType() + \"'.\");\n  }\n\n  /**\n   * Converts an Avro schema string into a nested row structure with deterministic field order and\n   * data types that are compatible with Flink's Table &amp; SQL API.\n   *\n   * @param avroSchemaString Avro schema definition string\n   * @return data type matching the schema\n   */\n  public static DataType convertToDataType(String avroSchemaString) {\n    return convertToDataType(avroSchemaString, true);\n  }\n\n  /**\n   * Converts an Avro schema string into a nested row structure with deterministic field order and\n   * data types that are compatible with Flink's Table &amp; SQL API.\n   *\n   * @param avroSchemaString Avro schema definition string","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/formats/avro/typeutils/AvroSchemaConverter.java#L218-L254","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Check which Avro type in the schema is unsupported (from the message and schema).","Switch to AvroSchemaConverter.convertToDataType, which supports a broader set of types.","Flatten or simplify the schema (e.g. unwrap unions) before conversion.","Upgrade the Flink/Iceberg version if the type was added in a newer Avro spec."],"exampleFix":"// before\nTypeInformation<Row> ti = AvroSchemaConverter.convertToTypeInfo(schemaString, true);\n// after\nDataType dt = AvroSchemaConverter.convertToDataType(schemaString, true); // broader type support","handlingStrategy":"validation","validationCode":"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 ...","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer convertToDataType over convertToTypeInfo for new code — broader type coverage.","Restrict Avro schemas to standard types and [null, T] unions.","Avoid logical types when targeting the legacy TypeInformation API.","Test schema conversion in CI whenever schemas change."],"tags":["flink","avro","unsupported-type"],"backgroundTag":"unsupported-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}