{"record":{"id":"4e05c390cf821229","repo":"apache/iceberg","slug":"unsupported-primitive-type-4e05c3","errorCode":null,"errorMessage":"Unsupported primitive type: ","messagePattern":"Unsupported primitive type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/ArrowSchemaUtil.java","lineNumber":184,"sourceCode":"          arrowType = new ArrowType.FixedSizeBinary(16);\n          break;\n        case TIMESTAMP:\n          arrowType =\n              new ArrowType.Timestamp(\n                  TimeUnit.MICROSECOND,\n                  ((Types.TimestampType) primitive).shouldAdjustToUTC() ? \"UTC\" : null);\n          break;\n        case TIMESTAMP_NANO:\n          arrowType =\n              new ArrowType.Timestamp(\n                  TimeUnit.NANOSECOND,\n                  ((Types.TimestampNanoType) primitive).shouldAdjustToUTC() ? \"UTC\" : null);\n          break;\n        case DATE:\n          arrowType = new ArrowType.Date(DateUnit.DAY);\n          break;\n        default:\n          throw new UnsupportedOperationException(\"Unsupported primitive type: \" + primitive);\n      }\n\n      return new Field(\n          currentField.name(),\n          new FieldType(currentField.isOptional(), arrowType, null),\n          Lists.newArrayList());\n    }\n  }\n}\n","sourceCodeStart":166,"sourceCodeEnd":194,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/ArrowSchemaUtil.java#L166-L194","documentation":"ArrowSchemaUtil.convertToArrowField's primitive() switch handles Iceberg's supported primitive types (long, float, timestamps, nanos, date, etc.). Any primitive type that falls past the switch — e.g. an unhandled or newly added Iceberg primitive — triggers this UnsupportedOperationException during Iceberg-to-Arrow schema conversion.","triggerScenarios":"Calling ArrowSchemaUtil.convertToArrowField (or converting a schema containing) a primitive type not covered by the switch, such as a newer Iceberg type or an unexpected UnknownType.","commonSituations":"Iceberg/Arrow version skew where the Arrow adapter predates a new Iceberg type; custom Type implementations; tables with type variants not yet mapped in this converter.","solutions":["Upgrade iceberg-arrow to a version whose convertToArrowField handles your table's types.","Check which primitive type is printed in the message and cast/filter it out before conversion, or project it to a supported type in the scan schema.","Add a case for the type in ArrowSchemaUtil if you control the build."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"schema.columns().forEach(c -> { if (c.type().isPrimitiveType()) { switch (c.type().typeId()) { case LONG: case FLOAT: case DOUBLE: case DATE: case TIMESTAMP: case TIMESTAMP_NANO: case BOOLEAN: case STRING: case BINARY: break; default: throw new IllegalArgumentException(\"Unsupported: \" + c.type()); } } });","typeGuard":"static boolean isArrowConvertible(Types.NestedField f) { switch (f.type().typeId()) { case LONG: case FLOAT: case DOUBLE: case DATE: case TIMESTAMP: case TIMESTAMP_NANO: case BOOLEAN: case STRING: case BINARY: return true; default: return false; } }","tryCatchPattern":"try { return ArrowSchemaUtil.convertToArrowField(field); } catch (UnsupportedOperationException e) { throw new IllegalStateException(\"Upgrade iceberg-arrow to support type: \" + field.type(), e); }","preventionTips":["Keep iceberg-arrow and iceberg-core versions aligned","Validate table schemas against supported Arrow types before vectorized reads"],"tags":["java","arrow","schema-conversion","type-mismatch"],"backgroundTag":"unsupported-dtype","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"}