{"record":{"id":"fb0d4515364b2726","repo":"apache/seatunnel","slug":"map-as-map-value-not-yet-implemented","errorCode":null,"errorMessage":"Map as map value not yet implemented","messagePattern":"Map as map value not yet implemented","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/MapTypeWriter.java","lineNumber":53,"sourceCode":"                \"Map type should be handled via FragmentConverter.writeMapToVector\");\n    }\n\n    @Override\n    public void writeToListWriter(\n            UnionListWriter writer, ArrowType arrowType, Object value, BufferAllocator allocator) {\n        throw new UnsupportedOperationException(\"Map in 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(\"Map 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(\"Map as map value not yet implemented\");\n    }\n}\n","sourceCodeStart":35,"sourceCodeEnd":56,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/MapTypeWriter.java#L35-L56","documentation":"MapTypeWriter.writeToMapValue rejects MAP values nested as values of another MAP in the Lance sink. Nested map-in-map writing is not implemented; the dispatch lands here and throws UnsupportedOperationException unconditionally.","triggerScenarios":"A MAP column declared as map<K, map<K2, V2>>; when FragmentConverter writes each entry's value, dispatch reaches MapTypeWriter.writeToMapValue.","commonSituations":"Hierarchical config/attribute data (nested dictionaries) ingested into Lance; schemas migrated from systems with arbitrary JSON-like nesting.","solutions":["Flatten nested maps to a single level with dotted/string-composed keys (e.g. \"a.b.c\" -> value).","Serialize inner maps to JSON strings so the value type is STRING.","Restructure as LIST<STRUCT<key, value>> for hierarchical data.","Implement nested map value writing via the UnionMapWriter value-writer API in a fork."],"exampleFix":"// before\ncolumns = \"attrs map<string, map<string, string>>\"\n\n// after: flattened keys\ncolumns = \"attrs map<string, string>\"  // keys like \"group.subgroup\"","handlingStrategy":"validation","validationCode":"// Java: reject nested map values\nArrowType valueType = mapField.getChildren().get(1).getType();\nif (valueType instanceof ArrowType.Map) {\n    throw new IllegalArgumentException(\"nested map values unsupported; flatten or JSON-encode\");\n}","typeGuard":"boolean isFlatMapValue(ArrowType t) {\n    return !(t instanceof ArrowType.Map);\n}","tryCatchPattern":null,"preventionTips":["Flatten hierarchical data into dotted key names at the source","JSON-encode inner maps into string values","Prefer list<struct> for hierarchical structures"],"tags":["lance","arrow","map-value","nested-type","sink"],"backgroundTag":"unsupported-operation","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"}