{"record":{"id":"ef9fd836e5b98dfc","repo":"apache/iceberg","slug":"invalid-iceberg-type-s-corresponding-to-orc-type-ef9fd8","errorCode":null,"errorMessage":"Invalid iceberg type %s corresponding to ORC type %s","messagePattern":"Invalid iceberg type (.+?) corresponding to ORC type (.+?)","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/data/FlinkOrcReader.java","lineNumber":132,"sourceCode":"          }\n        case TIMESTAMP_NANO:\n          Types.TimestampNanoType timestampNanoType = (Types.TimestampNanoType) iPrimitive;\n          if (timestampNanoType.shouldAdjustToUTC()) {\n            return FlinkOrcReaders.timestampTzs();\n          } else {\n            return FlinkOrcReaders.timestamps();\n          }\n        case STRING:\n          return FlinkOrcReaders.strings();\n        case UUID:\n        case FIXED:\n        case BINARY:\n          return OrcValueReaders.bytes();\n        case DECIMAL:\n          Types.DecimalType decimalType = (Types.DecimalType) iPrimitive;\n          return FlinkOrcReaders.decimals(decimalType.precision(), decimalType.scale());\n        default:\n          throw new IllegalArgumentException(\n              String.format(\n                  \"Invalid iceberg type %s corresponding to ORC type %s\", iPrimitive, primitive));\n      }\n    }\n  }\n}\n","sourceCodeStart":114,"sourceCodeEnd":139,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/data/FlinkOrcReader.java#L114-L139","documentation":"Guard in FlinkOrcReader.primitive: while mapping an ORC column reader, the Iceberg primitive type paired with the ORC type has no case in this switch (e.g. a timestamp_ntz, variant, or newly added primitive). The formatted message shows both the Iceberg and ORC types, pointing at the column whose type pair is unhandled.","triggerScenarios":"Reading ORC files whose projected Iceberg schema contains a primitive unsupported by the reader switch (only known primitives like BINARY/DECIMAL etc. are handled at that branch).","commonSituations":"Tables with newer Iceberg types read by an older iceberg-flink runtime; mismatched ORC type tags produced by other writers.","solutions":["Upgrade iceberg-flink to a version whose FlinkOrcReader supports the type.","Inspect the ORC file schema vs the Iceberg schema and align types (e.g. cast unsupported columns).","Add a reader mapping for the missing primitive if you own a patched build."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Types.NestedField f = schema.asStruct().field(name);\nif (f != null && !ORC_SUPPORTED.contains(f.type().asPrimitiveType().typeId())) {\n  throw new IllegalArgumentException(\"Type not readable from ORC: \" + f.type());\n}","typeGuard":null,"tryCatchPattern":"try { reader = FlinkOrcReader.factory.create(icebergType, orcType); } catch (IllegalArgumentException e) { /* skip column or fail fast */ }","preventionTips":["Align Iceberg and ORC schemas before reading.","Upgrade connector when tables use newer types.","Validate projections against supported ORC readers."],"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"}