{"record":{"id":"ce86da79ca367458","repo":"apache/beam","slug":"unsupported-integer-bit-width-type-getbitwidth","errorCode":null,"errorMessage":"Unsupported integer bit width: ${type.getBitWidth()}","messagePattern":"Unsupported integer bit width: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/arrow/src/main/java/org/apache/beam/sdk/extensions/arrow/ArrowConversion.java","lineNumber":188,"sourceCode":"                        toBeamField(childrenFields.get(1)).getType());\n                  }\n\n                  @Override\n                  public FieldType visit(ArrowType.Int type) {\n                    if (!type.getIsSigned()) {\n                      throw new IllegalArgumentException(\"Unsigned integers are not supported.\");\n                    }\n                    switch (type.getBitWidth()) {\n                      case 8:\n                        return FieldType.BYTE;\n                      case 16:\n                        return FieldType.INT16;\n                      case 32:\n                        return FieldType.INT32;\n                      case 64:\n                        return FieldType.INT64;\n                      default:\n                        throw new IllegalArgumentException(\n                            \"Unsupported integer bit width: \" + type.getBitWidth());\n                    }\n                  }\n\n                  @Override\n                  public FieldType visit(ArrowType.FloatingPoint type) {\n                    switch (type.getPrecision()) {\n                      case SINGLE:\n                        return FieldType.FLOAT;\n                      case DOUBLE:\n                        return FieldType.DOUBLE;\n                      default:\n                        throw new IllegalArgumentException(\n                            \"Unsupported floating-point precision: \" + type.getPrecision().name());\n                    }\n                  }\n\n                  @Override","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/arrow/src/main/java/org/apache/beam/sdk/extensions/arrow/ArrowConversion.java#L170-L206","documentation":"Thrown by ArrowConversion when converting an Arrow Int type to a Beam Schema FieldType and the Arrow integer's bit width is not 16, 32, or 64. The visitor handles 8-bit and unsigned variants by rejecting them because Beam has no direct mapping for those widths in this path.","triggerScenarios":"Calling the Arrow-to-Beam schema conversion (toBeamSchema / Row writer) on an Arrow field whose type is ArrowType.Int with getBitWidth() of 8, or any width outside {16,32,64} (e.g. bit width 8 from a tinyint column).","commonSituations":"Reading Arrow data produced by systems emitting 8-bit integers (e.g. Parquet tinyint, C-side int8), or a dependency upgrade in Arrow introducing new integer widths that this converter does not whitelist.","solutions":["Check the Arrow schema of your data and widen 8-bit integer columns to 16/32/64-bit before conversion (e.g. via Arrow's field/type transform).","If you control the producer, change the source schema to emit int16/int32/int64 columns.","Patch ArrowConversion to map 8-bit ints to FieldType.INT16 or INT32 if widening in Beam is acceptable, and file/track an upstream Beam issue."],"exampleFix":"// before\nField a = Field.nullable(\"a\", new ArrowType.Int(8, true));\n// after\nField a = Field.nullable(\"a\", new ArrowType.Int(16, true)); // or 32/64","handlingStrategy":"validation","validationCode":"for (Field f : schema.getFields()) {\n  if (f.getType() instanceof ArrowType.Int\n      && !Set.of(16, 32, 64).contains(((ArrowType.Int) f.getType()).getBitWidth())) {\n    throw new IllegalArgumentException(\n        \"Column \" + f.getName() + \" has unsupported int bit width \"\n        + ((ArrowType.Int) f.getType()).getBitWidth() + \"; widen to 16/32/64 first\");\n  }\n}","typeGuard":"boolean isConvertibleInt(ArrowType t) {\n  return t instanceof ArrowType.Int\n      && Set.of(16, 32, 64).contains(((ArrowType.Int) t).getBitWidth());\n}","tryCatchPattern":"try {\n  Schema beamSchema = ArrowConversion.toBeamSchema(arrowSchema);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unsupported integer bit width\")) {\n    arrowSchema = widenNarrowInts(arrowSchema); // then retry conversion\n  } else { throw e; }\n}","preventionTips":["Validate the Arrow schema against supported types before constructing VectorSchemaRoot or opening a source.","Standardize producers on int16/int32/int64 columns; never emit int8.","Add a unit test covering every column type in your real Arrow schema through toBeamSchema."],"tags":["java","arrow","beam","schema-conversion","unsupported-type"],"backgroundTag":"unsupported-dtype","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}