Kotlin / Kotlin/dataframe

Support exploding non-List collections (Set, Array) in `explode`

Open
#306 7 comments 0 reactions 1 assignee View on GitHub

@AndreiKingsley is already working on this.

Since Mar 26, 2026.

API enhancement
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

Problem

explode currently behaves differently depending on the collection type.

For List:

  • top-level elements are unpacked into rows

For Set / arrays:

  • behavior is inconsistent or not supported in the same way

Example expectation:

  • List<List<T>> → explode unpacks only the top level
  • Set<T> / Array<T> should behave the same way as List<T>

Currently this is not guaranteed or clearly defined.

Expected

explode should support common collection types consistently.

Defined behavior
  • List, Set, and arrays are treated as collections
  • explode unpacks only the top-level elements
  • Nested collections are not recursively flattened
Acceptance criteria
  • explode works for:
    • List<T>
    • Set<T>
    • Array<T>
  • Behavior matches List semantics (top-level unpack only)
  • Add tests for:
    • List<T>
    • Set<T>
    • Array<T>
  • Document supported collection types
Motivation

Users expect explode to work for standard collection types.

Inconsistent behavior between List and other collections makes API harder to reason about.

This is a small but important consistency fix before 1.0.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.