{"record":{"id":"5d02cb594afebf26","repo":"apache/iceberg","slug":"invalid-iceberg-type-s-corresponding-to-flink-log","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":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/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/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkOrcWriter.java#L147-L173","documentation":"FlinkOrcWriter maps Iceberg primitives to ORC writers given a Flink logical type. When the Iceberg primitive has no writer implementation in the switch, it throws IllegalArgumentException 'Invalid iceberg type %s corresponding to Flink logical type %s', identifying both types involved in the failed mapping.","triggerScenarios":"Writing ORC files where the table schema's Iceberg primitive cannot be mapped from the incoming Flink logical type (unsupported combination hits the default case).","commonSituations":"Newer Iceberg types flowing into an older Flink ORC writer; mismatched Flink LogicalType vs Iceberg type in converter configuration; module version skew.","solutions":["Upgrade iceberg-flink so the ORC writer supports the type","Change the Flink-to-Iceberg converter so it produces supported types for the column","Exclude the column from the write or store it as a supported type (e.g. bytes)"],"exampleFix":"// before\nTIMESTAMP_WITH_LOCAL_TIME_ZONE(9) -> FlinkOrcWriter throws\n// after\nUse timestamp(6) logical type or upgrade the connector","handlingStrategy":"validation","validationCode":"schema.columns().forEach(f -> { if (f.type().isPrimitiveType()) checkOrcWriterSupported(f.type().asPrimitiveType(), flinkType); });","typeGuard":null,"tryCatchPattern":"try { writeOrc(table); } catch (IllegalArgumentException e) { LOG.error(\"ORC write failed: {}\", e.getMessage()); throw e; }","preventionTips":["Map Flink LogicalTypes to Iceberg types via standard converters","Keep connector versions in sync","Validate schemas before job launch"],"tags":["flink","orc","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"}