{"record":{"id":"073f3dacfab7aff6","repo":"apache/iceberg","slug":"invalid-iceberg-type-s-corresponding-to-flink-log-073f3d","errorCode":null,"errorMessage":"Invalid iceberg type %s corresponding to Flink logical type %s","messagePattern":"Invalid iceberg type (.+?) corresponding to Flink logical type (.+?)","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/data/FlinkOrcWriter.java","lineNumber":165,"sourceCode":"          }\n        case TIMESTAMP_NANO:\n          Types.TimestampNanoType timestampNanoType = (Types.TimestampNanoType) iPrimitive;\n          if (timestampNanoType.shouldAdjustToUTC()) {\n            return FlinkOrcWriters.timestampNanoTzs();\n          } else {\n            return FlinkOrcWriters.timestampNanos();\n          }\n        case STRING:\n          return FlinkOrcWriters.strings();\n        case UUID:\n        case FIXED:\n        case BINARY:\n          return GenericOrcWriters.byteArrays();\n        case DECIMAL:\n          Types.DecimalType decimalType = (Types.DecimalType) iPrimitive;\n          return FlinkOrcWriters.decimals(decimalType.precision(), decimalType.scale());\n        default:\n          throw new IllegalArgumentException(\n              String.format(\n                  \"Invalid iceberg type %s corresponding to Flink logical type %s\",\n                  iPrimitive, flinkPrimitive));\n      }\n    }\n  }\n}\n","sourceCodeStart":147,"sourceCodeEnd":173,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/data/FlinkOrcWriter.java#L147-L173","documentation":"Guard in FlinkOrcWriter.primitive: no Iceberg primitive type matches the Flink logical type of the column being written (the switch over Iceberg primitives found no case for this pairing). The message shows both the Iceberg type and the Flink logical type; it fires at writer construction time.","triggerScenarios":"Writing a Flink RowData stream whose schema contains an Iceberg primitive the writer switch does not handle (e.g. new/unknown primitive or mismatched Iceberg-vs-Flink type pairs).","commonSituations":"Version skew between the connector and the table's schema types; constructing ORC writers from a Flink RowType that doesn't line up with the Iceberg schema.","solutions":["Upgrade iceberg-flink to a version supporting the primitive type.","Ensure the Flink schema passed to the writer matches the Iceberg table schema (same types, same order).","Add a writer mapping for the missing primitive in a patched build if it's a legitimately new type."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!WRITE_SUPPORTED.contains(primitive.typeId())) {\n  throw new IllegalArgumentException(\"Cannot write \" + primitive + \" via ORC writer\");\n}","typeGuard":null,"tryCatchPattern":"try { writer = FlinkOrcWriter.buildWriter(schema, flinkType); } catch (IllegalArgumentException e) { /* fail fast with schema mismatch */ }","preventionTips":["Keep the Flink RowType and Iceberg schema identical.","Pin connector version to one supporting the table's types.","Validate schemas at planning time instead of on write path."],"tags":["flink","orc","schema"],"backgroundTag":"type-mismatch","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"}