apache / apache/arrow-java

Avro adapter: AvroStringConsumer should use readString instead of readBytes

Open
#832 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.

Currently, `AvroStringConsumer` calls `decoder.readBytes` instead of `decoder.readString`. This can lead to exceptions when using `ResolvingDecoder`:

```
org.apache.avro.AvroTypeException: Attempt to process a bytes when a string was expected.

at org.apache.avro.io.parsing.Parser.advance(Parser.java:91)
at org.apache.avro.io.ResolvingDecoder.readBytes(ResolvingDecoder.java:236)
at org.apache.arrow.adapter.avro.consumers.AvroStringConsumer.consume(AvroStringConsumer.java:41)
```

Contributor guide

Open the contributing guide

Research direction

Start in AvroStringConsumer.java at the consume method and inspect how the decoder is used for Avro strings. Reproduce the ResolvingDecoder case described in the issue, then verify that the consumer handles string data without the reported AvroTypeException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.