{"record":{"id":"5b39a13179eb8b19","repo":"apache/iceberg","slug":"unsupported-type-primitive-5b39a1","errorCode":null,"errorMessage":"Unsupported type: ${primitive}","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetReaders.java","lineNumber":325,"sourceCode":"          return new ParquetValueReaders.ByteArrayReader(desc);\n        case INT32:\n          if (expected.typeId() == org.apache.iceberg.types.Type.TypeID.LONG) {\n            return new ParquetValueReaders.IntAsLongReader(desc);\n          } else {\n            return new ParquetValueReaders.UnboxedReader<>(desc);\n          }\n        case FLOAT:\n          if (expected.typeId() == org.apache.iceberg.types.Type.TypeID.DOUBLE) {\n            return new ParquetValueReaders.FloatAsDoubleReader(desc);\n          } else {\n            return new ParquetValueReaders.UnboxedReader<>(desc);\n          }\n        case BOOLEAN:\n        case INT64:\n        case DOUBLE:\n          return new ParquetValueReaders.UnboxedReader<>(desc);\n        default:\n          throw new UnsupportedOperationException(\"Unsupported type: \" + primitive);\n      }\n    }\n  }\n\n  private static class BinaryDecimalReader\n      extends ParquetValueReaders.PrimitiveReader<DecimalData> {\n    private final int precision;\n    private final int scale;\n\n    BinaryDecimalReader(ColumnDescriptor desc, int precision, int scale) {\n      super(desc);\n      this.precision = precision;\n      this.scale = scale;\n    }\n\n    @Override\n    public DecimalData read(DecimalData ignored) {\n      Binary binary = column.nextBinary();","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetReaders.java#L307-L343","documentation":"FlinkParquetReaders maps Parquet primitive column descriptors to Iceberg/Flink value readers. If the Parquet physical type has no reader implementation in the switch, it throws UnsupportedOperationException 'Unsupported type'. Only a fixed set of Parquet physical types is handled.","triggerScenarios":"Reading Parquet data files containing a physical type (e.g. legacy INT96 or an unrecognized type) not covered by the reader's switch.","commonSituations":"Parquet files written by foreign tools with legacy physical types (e.g. Hive INT96 timestamps); version skew between iceberg-parquet and iceberg-flink; corrupted file schemas.","solutions":["Rewrite the Parquet files with supported physical types (e.g. convert INT96 to INT64 timestamps)","Upgrade iceberg-flink/iceberg-parquet to a version with broader type support","Read the offending columns with a different engine or exclude them from the projection"],"exampleFix":"// before\nhive.write.parquet(INT96 timestamps) -> FlinkParquetReaders throws\n// after\nrewrite data with INT64 millis timestamps before reading via iceberg-flink","handlingStrategy":"validation","validationCode":"for (ColumnDescriptor d : parquetSchema.getColumns()) checkParquetTypeSupported(d.getPrimitive());","typeGuard":null,"tryCatchPattern":"try { read(scan); } catch (UnsupportedOperationException e) { LOG.error(\"Parquet read failed: {}\", e.getMessage()); throw e; }","preventionTips":["Avoid legacy physical types (e.g. INT96) when writing files with foreign tools","Standardize on INT64-based timestamps","Keep iceberg-flink/parquet versions aligned"],"tags":["flink","parquet","type-conversion"],"backgroundTag":"incompatible-source-type","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"}