{"record":{"id":"a85e32f660d68514","repo":"apache/seatunnel","slug":"unsupported-int-bit-width","errorCode":null,"errorMessage":"Unsupported Int bit width: ","messagePattern":"Unsupported Int bit width: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/IntTypeWriter.java","lineNumber":56,"sourceCode":"            BufferAllocator allocator) {\n        ArrowType.Int intType = (ArrowType.Int) arrowType;\n        int bitWidth = intType.getBitWidth();\n        Number numValue = (Number) value;\n        switch (bitWidth) {\n            case 8:\n                ((TinyIntVector) vector).setSafe(rowIndex, numValue.byteValue());\n                break;\n            case 16:\n                ((SmallIntVector) vector).setSafe(rowIndex, numValue.shortValue());\n                break;\n            case 32:\n                ((IntVector) vector).setSafe(rowIndex, numValue.intValue());\n                break;\n            case 64:\n                ((BigIntVector) vector).setSafe(rowIndex, numValue.longValue());\n                break;\n            default:\n                throw new IllegalArgumentException(\"Unsupported Int bit width: \" + bitWidth);\n        }\n    }\n\n    @Override\n    public void writeToListWriter(\n            UnionListWriter writer, ArrowType arrowType, Object value, BufferAllocator allocator) {\n        ArrowType.Int intType = (ArrowType.Int) arrowType;\n        int bitWidth = intType.getBitWidth();\n        Number numValue = (Number) value;\n        switch (bitWidth) {\n            case 8:\n                writer.writeTinyInt(numValue.byteValue());\n                break;\n            case 16:\n                writer.writeSmallInt(numValue.shortValue());\n                break;\n            case 32:\n                writer.writeInt(numValue.intValue());","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/IntTypeWriter.java#L38-L74","documentation":"IntTypeWriter.writeToVector switches on the Arrow IntType bitWidth (8/16/32/64) to pick the matching Arrow vector; any other bitWidth hits the default branch and throws IllegalArgumentException. It means the integer column's Arrow bit width is not a standard supported one.","triggerScenarios":"An ArrowType.Int with bitWidth other than 8, 16, 32, or 64 (or bitWidth 8/16 when their vectors are not registered in this writer version) reaches writeToVector.","commonSituations":"Hand-constructed Arrow schemas in tests or custom schema-conversion code using a wrong bitWidth; a Lance/Arrow SDK upgrade introducing a new integer variant the connector does not yet map.","solutions":["Use standard bit widths (8, 16, 32, 64) when building/converting the schema (IntType(32, true) etc.).","Fix the schema conversion utility that produced the nonstandard Int type.","Upgrade the connector if a new Arrow integer variant needs support."],"exampleFix":"// before\nnew ArrowType.Int(128, true) // invalid\n// after\nnew ArrowType.Int(64, true)","handlingStrategy":"validation","validationCode":"ArrowType t = field.getType(); if (t instanceof ArrowType.Int) { int bw = ((ArrowType.Int) t).getBitWidth(); if (bw != 8 && bw != 16 && bw != 32 && bw != 64) throw new IllegalArgumentException(\"unsupported int bit width \" + bw); }","typeGuard":null,"tryCatchPattern":"try { writer.write(row); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unsupported Int bit width\")) { /* fix schema to standard widths */ } throw e; }","preventionTips":["Use standard Arrow integer widths (8/16/32/64) in any schema conversion code.","Test custom schema builders against Arrow's canonical type list.","Keep the connector and Arrow SDK versions in sync."],"tags":["lance","arrow","integer","bit-width"],"backgroundTag":"unsupported-dtype","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}