Skip to content

Conversation

clairemcginty
Copy link
Contributor

Schema.Field in Avro 1.8 doesn't support the three-arg constructor that's available in 1.11:

https://github.com/apache/avro/blob/release-1.8.2/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L393-L424

vs

https://github.com/apache/avro/blob/release-1.11.4/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L588-L589

Switching to the four-arg constructor makes the storage write API compatible for Avro 1.8 through Avro 1.11.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@@ -350,10 +350,11 @@ private static TableFieldSchema fieldDescriptorFromAvroField(org.apache.avro.Sch
throw new RuntimeException("Unexpected null element type!");
}
TableFieldSchema keyFieldSchema =
fieldDescriptorFromAvroField(new Schema.Field("key", keyType, "key of the map entry"));
fieldDescriptorFromAvroField(
new Schema.Field("key", keyType, "key of the map entry", null));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

a null value is what Avro 1.11 defaults to, so there's no behavior change here: https://github.com/apache/avro/blob/release-1.11.4/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L588-L589

@Abacn
Copy link
Contributor

Abacn commented Mar 13, 2025

Thanks, could be a follow up, wondering if we should add a :sdks:java:io:google-cloud-platform:avroVersionsTest target run a matrix of avro version on some bigquery unit test, like what we are doing for :sdks:java:extensions:avro:avroVersionsTest, and add to

dependsOn(":sdks:java:extensions:avro:avroVersionsTest")

@clairemcginty
Copy link
Contributor Author

Thanks, could be a follow up, wondering if we should add a :sdks:java:io:google-cloud-platform:avroVersionsTest target run a matrix of avro version on some bigquery unit test, like what we are doing for :sdks:java:extensions:avro:avroVersionsTest, and add to

dependsOn(":sdks:java:extensions:avro:avroVersionsTest")

Yeah that's a good idea! I'm not sure if I have bandwidth to add it to this PR, but could maybe follow up in a week or so.

Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @kennknowles for label java.
R: @shunping for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@Abacn Abacn merged commit 085140a into apache:master Mar 14, 2025
17 checks passed
@clairemcginty clairemcginty deleted the avro-1.8-api-storageapi branch March 17, 2025 14:37
@clairemcginty
Copy link
Contributor Author

thanks @Abacn ! just for my planning, do you think this will make it into 2.64 release?

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

Successfully merging this pull request may close these issues.

2 participants