Skip to content

Upgrade Avro dependency from 1.11.5 to 1.12.2 - #3731

Open
iemejia wants to merge 2 commits into
apache:masterfrom
iemejia:parquet-avro-dep-upgrade
Open

Upgrade Avro dependency from 1.11.5 to 1.12.2#3731
iemejia wants to merge 2 commits into
apache:masterfrom
iemejia:parquet-avro-dep-upgrade

Conversation

@iemejia

@iemejia iemejia commented Aug 18, 2026

Copy link
Copy Markdown
Member

Rationale for this change

Upgrades the Avro dependency from 1.11.5 to 1.12.2.

Avro 1.12 introduces some behavioral and API-compatibility changes that require corresponding adjustments in parquet-avro:

  • Null logicalType NPE: GenericData.getConversionByClass no longer null-checks logicalType internally, so AvroRecordConverter.newConverter now guards against a null logicalType to avoid an NPE.
  • Stricter array typing: Avro 1.12's ReflectData.setField performs stricter type checks, so AvroArrayConverter.end now creates a typed array (via Array.newInstance(elementClass, 0)) instead of an untyped Object[].
  • ClassSecurityValidator: Avro 1.12's ClassSecurityValidator requires whitelisting serializable packages; the org.apache.avro.SERIALIZABLE_PACKAGES surefire system property is added for the tests.

What changes are included in this PR?

  • Bump avro.version to 1.12.2 in the root pom.xml.
  • Guard against null logicalType in AvroRecordConverter.newConverter.
  • Create typed arrays instead of Object[] in AvroArrayConverter.end.
  • Add the SERIALIZABLE_PACKAGES surefire property in parquet-avro/pom.xml.

Are these changes tested?

Yes, covered by the existing parquet-avro test suite.

Are there any user-facing changes?

Users of parquet-avro will now pull in Avro 1.12.2.

Comment thread parquet-avro/src/main/java/org/apache/parquet/avro/AvroRecordConverter.java Outdated
- Create typed arrays instead of Object[] in AvroArrayConverter.end to
  satisfy Avro 1.12's stricter ReflectData.setField type checks
- Add SERIALIZABLE_PACKAGES surefire property for Avro 1.12's
  ClassSecurityValidator
parent.add(((DoubleArrayList) container).toDoubleArray());
} else {
parent.add(((ArrayList) container).toArray());
parent.add(((ArrayList) container)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N.B. The cast to ArrayList isn't necessary.

This line change is due to a bugfix in Avro, tightening up the permitted values when setting reflected fields. The right thing to do here is to put an array of the actual type in the container (as opposed to Object[]).

The TestReflectLogicalTypes#testReadUUIDArray fails here without this change.

@RyanSkraba RyanSkraba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants