{"record":{"id":"16493999457a1b83","repo":"apache/seatunnel","slug":"unsupported-arrowtype-arrowtype-getclass-getn","errorCode":null,"errorMessage":"Unsupported ArrowType: ${arrowType.getClass().getName()}","messagePattern":"Unsupported ArrowType: (.+?)","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/TypeWriterFactory.java","lineNumber":44,"sourceCode":"    private static final Map<Class<? extends ArrowType>, TypeWriter> WRITERS = new HashMap<>();\n\n    static {\n        WRITERS.put(ArrowType.Int.class, new IntTypeWriter());\n        WRITERS.put(ArrowType.FloatingPoint.class, new FloatingPointTypeWriter());\n        WRITERS.put(ArrowType.Bool.class, new BoolTypeWriter());\n        WRITERS.put(ArrowType.Utf8.class, new Utf8TypeWriter());\n        WRITERS.put(ArrowType.Binary.class, new BinaryTypeWriter());\n        WRITERS.put(ArrowType.Decimal.class, new DecimalTypeWriter());\n        WRITERS.put(ArrowType.Date.class, new DateTypeWriter());\n        WRITERS.put(ArrowType.Timestamp.class, new TimestampTypeWriter());\n        WRITERS.put(ArrowType.List.class, new ListTypeWriter());\n        WRITERS.put(ArrowType.Map.class, new MapTypeWriter());\n    }\n\n    public static TypeWriter getWriter(ArrowType arrowType) {\n        TypeWriter writer = WRITERS.get(arrowType.getClass());\n        if (writer == null) {\n            throw new IllegalArgumentException(\n                    \"Unsupported ArrowType: \" + arrowType.getClass().getName());\n        }\n        return writer;\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":50,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/TypeWriterFactory.java#L26-L50","documentation":"TypeWriterFactory.getWriter looks up a TypeWriter by the ArrowType implementation class in a static registry (Int, FloatingPoint, Utf8, Binary, Bool, Date, Time, TimeStamp, Map, etc.). If the resolved field's ArrowType class has no registered writer, this IllegalArgumentException is thrown. It signals the Lance connector does not support that Arrow type in the sink write path.","triggerScenarios":"A column's SeaTunnel type translates to an ArrowType with no registry entry — e.g. Decimal, DenseUnion, Union, Duration, Interval, or FixedSizeBinary — and FragmentConverter calls TypeWriterFactory.getWriter(field.getType()).","commonSituations":"DECIMAL/NUMERIC columns from databases (Arrow Decimal type); union or interval types from Flink/Spark sources; new SeaTunnel types added without corresponding Lance connector support.","solutions":["Identify the unsupported Arrow type from the exception message and cast the column to a supported type (string, int, double, bool, date, timestamp) in the pipeline.","For decimals, cast to DOUBLE or scale to a string before writing to Lance.","Register a TypeWriter for the missing ArrowType class in TypeWriterFactory's static map if you maintain a fork.","Check the Lance connector docs/source for the supported type matrix and align your schema with it."],"exampleFix":"// before\ncolumns = \"price decimal(38,10)\"  // -> Arrow Decimal, no writer\n\n// after\ncolumns = \"price double\"  // or cast decimal to double upstream","handlingStrategy":"validation","validationCode":"// Java: verify every field type has a registered writer before writing\nfor (Field f : schema.getFields()) {\n    try {\n        TypeWriterFactory.getWriter(f.getType());\n    } catch (IllegalArgumentException e) {\n        throw new IllegalArgumentException(\"Column '\" + f.getName() + \"' uses unsupported type \" + f.getType());\n    }\n}","typeGuard":"boolean hasWriter(ArrowType t) {\n    try { TypeWriterFactory.getWriter(t); return true; }\n    catch (IllegalArgumentException e) { return false; }\n}","tryCatchPattern":"try {\n    TypeWriter w = TypeWriterFactory.getWriter(arrowType);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported ArrowType\")) {\n        throw new IllegalArgumentException(\"Cast column to a supported type (string/int/double/bool/date/timestamp): \" + e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Cast decimal/union/interval columns to supported types before the Lance sink","Run a schema pre-flight check against the supported type matrix at job startup","Review the connector source's TypeWriterFactory registry when adding new column types"],"tags":["lance","arrow","type-dispatch","unsupported-type","sink"],"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"}