apache / apache/arrow-java

JsonFileWriter fails with NPE after VectorSchemaRoot syncSchema

Open
#390 0 comments 0 reactions 0 assignees View on GitHub
Type: bug
Dominant language
Java
Stars
94
Forks
152
Avg merge
3d 16h
Merged PRs (30d)
11

Description

Hey there :)

Repro:
- Open VSR
- Do something that'll change the `Field` of one of the vectors in the VSR (promotable writer, etc)
- `vsr.syncSchema()`
- Open JsonFileWriter, `start`, `write` -> NPE

Looks like the cause is that the `fieldVectorsMap` cache isn't updated in `syncSchema`? Possibly a few other places - `addVector`/`removeVector` too?

Cheers,

James

**Reporter**: [James Henderson](https://issues.apache.org/jira/browse/ARROW-11385) / @jarohen

**Note**: *This issue was originally created as [ARROW-11385](https://issues.apache.org/jira/browse/ARROW-11385). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Research direction

Reproduce the sequence involving VectorSchemaRoot, syncSchema, and JsonFileWriter, then inspect the fieldVectorsMap cache and the addVector/removeVector paths mentioned in the report. Done means JsonFileWriter can start and write after a vector Field changes and syncSchema completes without an NPE.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.