apache/beam · error · IllegalArgumentException

Unsigned integers are not supported.

Error message

Unsigned integers are not supported.

What it means

While converting an Arrow field type to a Beam schema field type, the visitor hit an Arrow unsigned integer type (UInt8/16/32/64). Beam's schema type system has no unsigned integer types, so the conversion refuses rather than silently narrowing; the Arrow uint field being converted is the input at fault.

Source

Thrown at sdks/java/extensions/arrow/src/main/java/org/apache/beam/sdk/extensions/arrow/ArrowConversion.java:176

                        "Type \'" + type.toString() + "\' not supported.");
                  }

                  @Override
                  public FieldType visit(ArrowType.Map type) {
                    checkArgument(
                        childrenFields.size() == 2,
                        "Encountered "
                            + childrenFields.size()
                            + " child fields for map type, expected 2");
                    return FieldType.map(
                        toBeamField(childrenFields.get(0)).getType(),
                        toBeamField(childrenFields.get(1)).getType());
                  }

                  @Override
                  public FieldType visit(ArrowType.Int type) {
                    if (!type.getIsSigned()) {
                      throw new IllegalArgumentException("Unsigned integers are not supported.");
                    }
                    switch (type.getBitWidth()) {
                      case 8:
                        return FieldType.BYTE;
                      case 16:
                        return FieldType.INT16;
                      case 32:
                        return FieldType.INT32;
                      case 64:
                        return FieldType.INT64;
                      default:
                        throw new IllegalArgumentException(
                            "Unsupported integer bit width: " + type.getBitWidth());
                    }
                  }

                  @Override
                  public FieldType visit(ArrowType.FloatingPoint type) {

View on GitHub (pinned to 12126d8942)

Solutions

  1. Cast unsigned columns to the next-wider signed type (uint32 -> int64) before conversion
  2. Cast to string if values may exceed signed range and parse in Beam
  3. Drop or remap the unsigned fields from the Arrow schema
  4. Catch IllegalArgumentException and widen the column automatically when detecting getIsSigned()==false

Example fix

// before
pa.array(np.array([1,2,3], dtype=np.uint32))
// after
pa.array(np.array([1,2,3], dtype=np.int64))
Defensive patterns

Strategy: validation

Validate before calling

for (org.apache.arrow.vector.types.pojo.Field f : arrowSchema.getFields()) {
  if (f.getType() instanceof ArrowType.Int && !((ArrowType.Int) f.getType()).getIsSigned()) {
    throw new IllegalArgumentException("Unsigned column: " + f.getName());
  }
}

Try / catch

try { beamSchema = toBeamSchema(arrowSchema); } catch (IllegalArgumentException e) { arrowSchema = widenUnsignedToInt64(arrowSchema); beamSchema = toBeamSchema(arrowSchema); }

Prevention

When it happens

Trigger: Converting Arrow schemas with unsigned integer columns (uint8/uint16/uint32/uint64) — typical of data read from Parquet/CSV/NumPy that used unsigned types.

Common situations: pyarrow arrays built from numpy uint arrays; Parquet files storing unsigned logical types; bitmap/ID columns encoded as uint64.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/93e8730d3baa7357. Report an issue: GitHub.