Skip to content

AVRO-4242: [Java] Fix NPE in DataFileStream and DataFileReader when s…#3726

Open
iemejia wants to merge 1 commit intoapache:mainfrom
iemejia:AVRO-4242-mlaformed-avro-container-no-schema-npe
Open

AVRO-4242: [Java] Fix NPE in DataFileStream and DataFileReader when s…#3726
iemejia wants to merge 1 commit intoapache:mainfrom
iemejia:AVRO-4242-mlaformed-avro-container-no-schema-npe

Conversation

@iemejia
Copy link
Copy Markdown
Member

@iemejia iemejia commented Apr 6, 2026

…chema metadata is missing

Malformed Avro container files without the 'avro.schema' metadata entry caused a NullPointerException in both DataFileStream and DataFileReader12 when the null value was passed directly to Schema.Parser.parse(). Replace inline parsing with null-safe helper methods that throw a descriptive IOException instead.

What is the purpose of the change

(For example: This pull request improves file read performance by buffering data, fixing AVRO-XXXX.)

Verifying this change

(Please pick one of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Extended interop tests to verify consistent valid schema names between SDKs
  • Added test that validates that Java throws an AvroRuntimeException on invalid binary data
  • Manually verified the change by building the website and checking the new redirect

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

…chema metadata is missing

Malformed Avro container files without the 'avro.schema' metadata entry
caused a NullPointerException in both DataFileStream and DataFileReader12
when the null value was passed directly to Schema.Parser.parse(). Replace
inline parsing with null-safe helper methods that throw a descriptive
IOException instead.
@github-actions github-actions bot added the Java Pull Requests for Java binding label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java Pull Requests for Java binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant