{"record":{"id":"4ee498adb97a9e3f","repo":"apache/seatunnel","slug":"unsupported-floatingpoint-precision","errorCode":null,"errorMessage":"Unsupported FloatingPoint precision: ","messagePattern":"Unsupported FloatingPoint precision: ","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/FloatingPointTypeWriter.java","lineNumber":45,"sourceCode":"import org.apache.arrow.vector.types.pojo.ArrowType;\n\n/** Writer for FloatingPoint type. */\npublic class FloatingPointTypeWriter extends BaseTypeWriter {\n    @Override\n    public void writeToVector(\n            FieldVector vector,\n            ArrowType arrowType,\n            Object value,\n            int rowIndex,\n            BufferAllocator allocator) {\n        ArrowType.FloatingPoint fpType = (ArrowType.FloatingPoint) arrowType;\n        Number numValue = (Number) value;\n        if (fpType.getPrecision() == FloatingPointPrecision.SINGLE) {\n            ((Float4Vector) vector).setSafe(rowIndex, numValue.floatValue());\n        } else if (fpType.getPrecision() == FloatingPointPrecision.DOUBLE) {\n            ((Float8Vector) vector).setSafe(rowIndex, numValue.doubleValue());\n        } else {\n            throw new IllegalArgumentException(\n                    \"Unsupported FloatingPoint precision: \" + fpType.getPrecision());\n        }\n    }\n\n    @Override\n    public void writeToListWriter(\n            UnionListWriter writer, ArrowType arrowType, Object value, BufferAllocator allocator) {\n        ArrowType.FloatingPoint fpType = (ArrowType.FloatingPoint) arrowType;\n        Number numValue = (Number) value;\n        if (fpType.getPrecision() == FloatingPointPrecision.SINGLE) {\n            writer.writeFloat4(numValue.floatValue());\n        } else if (fpType.getPrecision() == FloatingPointPrecision.DOUBLE) {\n            writer.writeFloat8(numValue.doubleValue());\n        }\n    }\n\n    @Override\n    public void writeToMapKey(","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/FloatingPointTypeWriter.java#L27-L63","documentation":"FloatingPointTypeWriter.writeToVector maps Arrow FloatingPoint precision to Float4Vector (SINGLE) or Float8Vector (DOUBLE). Arrow defines only HALF/SINGLE/DOUBLE; HALF is not handled, so a HALF precision field reaches the else branch and throws IllegalArgumentException. It means the writer cannot serialize the float value into a vector of that precision.","triggerScenarios":"A field's ArrowType is FloatingPoint with precision HALF (Float16) and writeToVector is called for it.","commonSituations":"Dataset schema created externally with half-float columns (common in ML/embedding data stored in Lance) being written by this SeaTunnel connector, which lacks Float16 support.","solutions":["Change the target column to SINGLE (float4) or DOUBLE (float8) precision, recreating the dataset if needed.","Cast half-float values to float in the upstream transform before the sink.","Upgrade the connector if Float16 support is added in a newer version."],"exampleFix":"// before\nnew ArrowType.FloatingPoint(FloatingPointPrecision.HALF)\n// after\nnew ArrowType.FloatingPoint(FloatingPointPrecision.SINGLE)","handlingStrategy":"validation","validationCode":"ArrowType t = field.getType(); if (t instanceof ArrowType.FloatingPoint && ((ArrowType.FloatingPoint) t).getPrecision() == FloatingPointPrecision.HALF) throw new IllegalArgumentException(\"HALF float not supported by lance sink\");","typeGuard":null,"tryCatchPattern":"try { writer.write(row); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unsupported FloatingPoint precision\")) { /* recast column to SINGLE/DOUBLE */ } throw e; }","preventionTips":["Avoid half-float (Float16) columns in datasets written by this sink.","Use SINGLE or DOUBLE precision when creating the dataset schema.","Cast ML/embedding vectors from float16 to float32 upstream."],"tags":["lance","arrow","float","unsupported"],"backgroundTag":"unsupported-dtype","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}