{"record":{"id":"8bc8b337aad7ebdb","repo":"apache/iceberg","slug":"unsupported-type-type-8bc8b3","errorCode":null,"errorMessage":"Unsupported type: ${type}","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/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/v1.20/flink/src/main/java/org/apache/iceberg/flink/formats/avro/AvroToRowDataConverters.java#L121-L157","documentation":"AvroToRowDataConverters.createConverter maps Flink LogicalTypes to Avro→RowData converters. TIMESTAMP_WITH_LOCAL_TIME_ZONE is only supported when legacy timestamp-to-atomic mapping is disabled; with table property format-version/timestamp mapping set to legacy (read.timestamp-unit legacy / avro timestamp mapping), it throws UnsupportedOperationException.","triggerScenarios":"Reading an Avro-encoded Iceberg table with a TIMESTAMP_WITH_LOCAL_TIME_ZONE (timestamptz) column while legacyTimestampMapping is true (table property 'format-version'=1 timestamp mapping or timestamp-without-time-zone-avro-mapping set to legacy).","commonSituations":"Older tables written before timestamptz-in-avro support, or tables configured with legacy avro timestamp mapping, read by newer flink iceberg readers that require modern mapping.","solutions":["Disable legacy timestamp mapping: rewrite the table (e.g. via Spark procedure rewrite or table property) so timestamptz columns use the modern Avro logical type mapping.","Set the table property 'timestamp-without-time-zone-avro-mapping' / related avro mapping properties to the non-legacy (int64 micros) scheme and rewrite data files.","Avoid timestamptz columns in the affected table, or cast them to timestamp-without-time-zone in the query.","If the legacy mapping is required, use a reader/writer version that predates or supports the legacy path."],"exampleFix":"// before (legacy mapping enabled)\ntable.updateProperties().set(\"timestamp-without-time-zone-avro-mapping\", \"legacy-micros\").commit();\n// after\ntable.updateProperties().set(\"timestamp-without-time-zone-avro-mapping\", \"adjusted-micros\").commit();","handlingStrategy":"validation","validationCode":"if (type instanceof TimestampType && ((TimestampType) type).isLocal() && legacyTimestampMapping) {\n  throw new IllegalArgumentException(\"legacyTimestampMapping not allowed with timestamptz column\");\n}","typeGuard":null,"tryCatchPattern":"try { avroReader.open(); } catch (UnsupportedOperationException e) { // legacy mapping conflict: rewrite table or drop mapping property }","preventionTips":["Don't enable legacy avro timestamp-mapping properties on tables with timestamptz columns","Rewrite legacy data files to the modern micros mapping before reading with new readers","Audit table properties before switching reader versions"],"tags":["flink","avro","timestamp","legacy-mapping"],"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-14T16:17:12.679Z"}