apache / apache/arrow-java

[Vector][ExtensionType] ComplexCopier requires that extension types' holder readers implement getField

Open
#1,109 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

### Describe the bug, including details regarding any error messages, version, and platform.

https://github.com/apache/arrow-java/pull/892 made efforts to streamline and simplify extension readers and writers. In this, `ComplexCopier.copy` relies on `FieldReader.getField` being defined for extension types.

Usages of `ComplexCopier.copy` with readers backed by vector, e.g., `UuidReaderImpl` and `VariantReaderImpl` that do have `getField` implementation, should be OK (as there is concrete notion of Field). However, if holder readers, namely, `NullableUuidHolderReaderImpl` or `NullableVariantHolderReaderImpl` are used this results in an NPE.

Having said that `getField` method for holder readers appears to be a misnomer as we do not have a notion of a field for the holders. This can be seen from the absence of `getField` overrides for primitive types.

Contributor guide

Open the contributing guide

Research direction

Start by reading ComplexCopier.copy and compare the getField implementations in UuidReaderImpl and VariantReaderImpl with NullableUuidHolderReaderImpl and NullableVariantHolderReaderImpl. Reproduce the NPE with a holder-backed extension reader, then verify that copying no longer requires an inappropriate getField implementation for holders.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.