{"record":{"id":"a931d3871f423e27","repo":"apache/seatunnel","slug":"nested-list-writing-not-yet-implemented","errorCode":null,"errorMessage":"Nested list writing not yet implemented","messagePattern":"Nested list writing not yet implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/ListTypeWriter.java","lineNumber":42,"sourceCode":"import org.apache.arrow.vector.types.pojo.ArrowType;\n\n/** Writer for List type - placeholder, actual implementation handled separately. */\npublic class ListTypeWriter extends BaseTypeWriter {\n    @Override\n    public void writeToVector(\n            FieldVector vector,\n            ArrowType arrowType,\n            Object value,\n            int rowIndex,\n            BufferAllocator allocator) {\n        throw new UnsupportedOperationException(\n                \"List type should be handled via FragmentConverter.writeListToVector\");\n    }\n\n    @Override\n    public void writeToListWriter(\n            UnionListWriter writer, ArrowType arrowType, Object value, BufferAllocator allocator) {\n        throw new UnsupportedOperationException(\"Nested list writing not yet implemented\");\n    }\n\n    @Override\n    public void writeToMapKey(\n            UnionMapWriter writer, ArrowType arrowType, Object value, BufferAllocator allocator) {\n        throw new UnsupportedOperationException(\"List as map key is not supported\");\n    }\n\n    @Override\n    public void writeToMapValue(\n            UnionMapWriter writer, ArrowType arrowType, Object value, BufferAllocator allocator) {\n        throw new UnsupportedOperationException(\"List as map value not yet implemented\");\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":57,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/ListTypeWriter.java#L24-L57","documentation":"ListTypeWriter.writeToListWriter (used for nested list values inside UnionListWriter, e.g. list<list<...>> or lists reached via writeToMapValue) is not implemented and always throws UnsupportedOperationException. The connector supports only top-level lists via FragmentConverter; nesting lists inside lists or inside map values is unsupported.","triggerScenarios":"Writing a row whose field is a list of lists (or a map value that is a list) so that the writer dispatches to writeToListWriter for the inner list.","commonSituations":"Source data with nested array columns (e.g. JSON arrays of arrays, nested protobuf repeated fields) being sunk to Lance; schema containing list<list<int>> or map<string, list<...>>.","solutions":["Flatten the nested structure upstream (explode arrays in a transform, or serialize to JSON string) before the Lance sink.","Change the target schema so lists are only at the top level.","Track/upgrade the connector for nested-list support if it is implemented in a newer version."],"exampleFix":"// before\nrow.setField(i, List.of(List.of(1, 2), List.of(3))); // list<list<int>>\n// after\nrow.setField(i, List.of(1, 2, 3)); // flattened, or toJsonString for nested data","handlingStrategy":"validation","validationCode":"// reject nested lists before writing\nstatic void assertNoNestedLists(org.apache.arrow.vector.types.pojo.Schema s) { for (var f : s.getFields()) { var t = f.getType(); if (t instanceof ArrowType.List && ((org.apache.arrow.vector.complex.ListVector) null) != null) {} if (isNestedList(f)) throw new IllegalArgumentException(\"nested list unsupported: \" + f.getName()); } }","typeGuard":"static boolean isNestedList(org.apache.arrow.vector.types.pojo.Field f) { if (!(f.getType() instanceof ArrowType.List)) return false; return f.getChildren().stream().anyMatch(c -> c.getType() instanceof ArrowType.List); }","tryCatchPattern":"try { writer.write(row); } catch (UnsupportedOperationException e) { if (e.getMessage().contains(\"Nested list writing not yet implemented\")) { /* flatten or serialize to JSON upstream */ } throw e; }","preventionTips":["Inspect the dataset/source schema for list<list<...>> or map values containing lists before choosing the Lance sink.","Flatten arrays (explode) or serialize nested structures to JSON strings upstream.","Design target Lance schemas with lists only at the top level."],"tags":["lance","arrow","list","nested","unsupported"],"backgroundTag":"method-not-implemented","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"}