Skip to content

Arrow feather deserialization of dataframe with column group #1044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ian-k opened this issue Jan 31, 2025 · 0 comments
Open

Arrow feather deserialization of dataframe with column group #1044

ian-k opened this issue Jan 31, 2025 · 0 comments

Comments

@ian-k
Copy link

ian-k commented Jan 31, 2025

When serializing dataframe with GroupColumn(s) after de-serialization the columns are represented as ValueColumns.

@test
fun testMultilevel() {
val rangeRows = (1..3).toList()
val downColsRange = 1..4
val middleColRange = 1..3
val topColRange=1..2

    val IID = columnOf(*rangeRows.toTypedArray()).map { "IID$it" }.named("IID")

    val topCols = topColRange.map { tc->
        columnOf( middleColRange.map { mc ->
            columnOf( downColsRange.map { dc ->
                columnOf(*rangeRows.toTypedArray()).named("$tc-$mc-down$dc").map{Random.nextDouble()} }
            ).named("$tc-middle$mc")
        }).named("top$tc")
    }

    val col2add = columnOf(*rangeRows.toTypedArray()).map { "NEW$it" }.named("Calc")

    val frame = dataFrameOf(IID,*topCols.toTypedArray())


    frame.writeArrowFeather(File("output2.arrow"))

    val arr = AnyFrame.readArrowFeather(File("output2.arrow"))
    println(arr.columnTypes())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant