Large schema mismatches in RecordBatch to StructArray conversion are hard to debug #187
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
question
Further information is requested
When turning an Arrow
RecordBatch
into a NarrowStructArray
, if there is a schema mismatch, there is currently a panic, e.g.:I believe this message originates from Arrow, not Narrow.
With structs that have many (nested) fields, it is difficult to figure out which field exactly is wrongly typed, since this message only contains the type and not the field name.
It would be great if the panic message would contain the field name.
Perhaps this is not trivial to implement, so alternatively it would be useful to be able to call something like
fn schema() -> arrow_schema::Schema
on the NarrowStructArray
such that users could perform run-time schema validation before trying to convert. I haven't done a thorough search, but from a quick glance, I don't see anything that would specifically report schema mismatches in a friendlier way inarrow_schema
, yet I can imagine adding such functionality. This could then be leveraged with the proposedschema
function (and prevent panics).The text was updated successfully, but these errors were encountered: