-
Notifications
You must be signed in to change notification settings - Fork 19
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
Can't write an Arrow table if it contains list #606
Comments
If you compile with With the test in #607, the error is:
So the rust code is panicking on this line: https://github.com/apache/arrow-rs/blob/5414f1d7c0683c64d69cf721a83c17d677c78a71/arrow-ipc/src/convert.rs#L98 If we load this data in pyarrow, we see:
So the list's inner field does not have a name set. I'm not sure if that's allowed by the spec (it's rare at least). Either the JS IPC writer or the Rust IPC reader is incorrect. |
I checked with @jorisvandenbossche and saw that the IPC spec doesn't require a name to be set, so this is an issue on the Rust side. (Though there should be a default name set) |
Created apache/arrow-rs#6415. Otherwise, you can work around this by manually setting a field name for any inner lists. |
Thanks for the commentary. The type inference done be I was then able to get around the issue by passing in the List type directly: import { Field, Int32, List, tableFromArrays, tableToIPC, vectorFromArray } from "apache-arrow"
import { Table } from "parquet-wasm"
const table = tableFromArrays({
column: vectorFromArray(
[[1, 2], [3, 4]],
new List(new Field("_", new Int32())) // fails if "" passed instead
),
})
const ipc = tableToIPC(table, "stream")
Table.fromIPCStream(ipc) This is a fine workaround for me. |
I'm expecting the following code to work but am getting an error "RuntimeError: unreachable" when running in Node.js v20.17.0, thrown by
fromIPCStream()
.I tried changing "stream" to "file" but that didn't work either with the error "Io error: failed to fill whole buffer".
I was able to get other examples working locally that didn't have a list (for example,
column: [1, 2]
andcolumn: [{a: 1}, {a: 2}]
).It does work if using typed arrays:
column: [new Int32Array([1, 2]), new Int32Array([3, 4])]
. So, I do have a workaround. However, I originally wanted to write a list of structs with Int32 values and now will have to do a struct of typed arrays. Perhaps that is what is intended.The text was updated successfully, but these errors were encountered: