{"record":{"id":"e5dea8574f39c253","repo":"apache/iceberg","slug":"unsupported-type-type-e5dea8","errorCode":null,"errorMessage":"Unsupported type: \" + type","messagePattern":"Unsupported type: \" \\+ type","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/formats/avro/AvroToRowDataConverters.java","lineNumber":139,"sourceCode":"        return avroObject -> ((Integer) avroObject).shortValue();\n      case BOOLEAN: // boolean\n      case INTEGER: // int\n      case INTERVAL_YEAR_MONTH: // long\n      case BIGINT: // long\n      case INTERVAL_DAY_TIME: // long\n      case FLOAT: // float\n      case DOUBLE: // double\n        return avroObject -> avroObject;\n      case DATE:\n        return AvroToRowDataConverters::convertToDate;\n      case TIME_WITHOUT_TIME_ZONE:\n        return AvroToRowDataConverters::convertToTime;\n      case TIMESTAMP_WITHOUT_TIME_ZONE:\n        // Iceberg: Added support for nanoseconds precision (FLINK-39251)\n        return avroObject -> convertToTimestamp(avroObject, type);\n      case TIMESTAMP_WITH_LOCAL_TIME_ZONE:\n        if (legacyTimestampMapping) {\n          throw new UnsupportedOperationException(\"Unsupported type: \" + type);\n        } else {\n          // Iceberg: Added support for nanoseconds precision (FLINK-39251)\n          return avroObject -> convertToTimestamp(avroObject, type);\n        }\n      case CHAR:\n      case VARCHAR:\n        return avroObject -> StringData.fromString(avroObject.toString());\n      case BINARY:\n      case VARBINARY:\n        return AvroToRowDataConverters::convertToBytes;\n      case DECIMAL:\n        return createDecimalConverter((DecimalType) type);\n      case ARRAY:\n        return createArrayConverter((ArrayType) type, legacyTimestampMapping);\n      case ROW:\n        return createRowConverter((RowType) type);\n      case MAP:\n      case MULTISET:","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/formats/avro/AvroToRowDataConverters.java#L121-L157","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["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).","Change the field type from TIMESTAMP_WITH_LOCAL_TIME_ZONE to TIMESTAMP_WITHOUT_TIME_ZONE if UTC-less semantics are acceptable.","Pre-convert the Avro field to a supported logical type before reading."],"exampleFix":"// before\ntable.option(\"table.local-time-zone\", ...); // legacy timestamp mapping enabled\n// after\n// remove legacy mapping option so TIMESTAMP_WITH_LOCAL_TIME_ZONE is supported\nDynamicTableSink sink = ... // no legacy timestamp option","handlingStrategy":"validation","validationCode":"// before reading, check the format/table options\nboolean legacy = options.get(\"table.local-time-zone-legacy\") != null; // or the legacy mapping option\nif (legacy && schema.getFieldCount(...) instanceof TimestampType(false, _)) { throw new ConfigException(\"Disable legacy timestamp mapping to read TIMESTAMP_WITH_LOCAL_TIME_ZONE\"); }","typeGuard":null,"tryCatchPattern":"try { RowData row = converter.convert(avroRecord); } catch (UnsupportedOperationException e) { /* reconfigure legacy mapping or remap the field */ }","preventionTips":["Do not enable legacy timestamp mapping when the schema has local-zoned timestamps.","Audit table/format options after Flink/Iceberg upgrades.","Prefer TIMESTAMP_WITH_LOCAL_TIME_ZONE only with non-legacy mapping."],"tags":["flink","avro","timestamp","legacy-mapping"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}