apache/seatunnel · error · UnsupportedOperationException

List as map value not yet implemented

Error message

List as map value not yet implemented

What it means

ListTypeWriter.writeToMapValue rejects ARRAY values used as MAP values in the Lance sink. The implementation is a placeholder — nested list writing inside Arrow map value vectors has not been implemented in this connector. It throws UnsupportedOperationException unconditionally.

Source

Thrown at seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/ListTypeWriter.java:54

                "List type should be handled via FragmentConverter.writeListToVector");
    }

    @Override
    public void writeToListWriter(
            UnionListWriter writer, ArrowType arrowType, Object value, BufferAllocator allocator) {
        throw new UnsupportedOperationException("Nested list writing not yet implemented");
    }

    @Override
    public void writeToMapKey(
            UnionMapWriter writer, ArrowType arrowType, Object value, BufferAllocator allocator) {
        throw new UnsupportedOperationException("List as map key is not supported");
    }

    @Override
    public void writeToMapValue(
            UnionMapWriter writer, ArrowType arrowType, Object value, BufferAllocator allocator) {
        throw new UnsupportedOperationException("List as map value not yet implemented");
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Flatten the nested structure: use one row per key/element pair, or store the list as a JSON string column inside the map.
  2. Restructure the schema to LIST<STRUCT<key, value>> instead of MAP<K, LIST<V>>.
  3. Implement writeToMapValue in ListTypeWriter using the UnionMapWriter's value writer API if you maintain a fork.
  4. Check connector release notes for when nested map-value writing is implemented before relying on it.

Example fix

// before: map with list value
columns = "tags map<string, array<string>>"

// after: JSON-encoded value
columns = "tags map<string, string>"  // value = JSON string of the list
Defensive patterns

Strategy: validation

Validate before calling

// Java: reject list map-values before writing
ArrowType valueType = mapField.getChildren().get(1).getType();
if (valueType instanceof ArrowType.List) {
    throw new IllegalArgumentException("map value cannot be a list in Lance sink; use JSON string or struct list");
}

Type guard

boolean isSupportedMapValue(ArrowType t) {
    return !(t instanceof ArrowType.List) && !(t instanceof ArrowType.Map);
}

Prevention

When it happens

Trigger: A SeaTunnel row's MAP field is declared with an ARRAY (list) value type; when FragmentConverter writes each entry, the value dispatch reaches ListTypeWriter.writeToMapValue, which always throws.

Common situations: Schema like map<string, array<int>> (e.g. tags per user, labels per id) synced into Lance; users migrating from other sinks that support nested map values assuming Lance connector parity.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/be7ce18296c1a10c. Report an issue: GitHub.