Skip to content

Conversation

@mkeskells
Copy link
Contributor

What is the purpose of the change

  • Fix the class cast exceptions noted in the ticket (when using logical types)
  • Fix other paths that can return PrimitiveArray when it would not be appropriate
  • Tightness the constraints for the return value, so if a GenericContainer is returned the schema must match the supplied schema

appropriate means that

  • If the suppled value could act as a container for the values that will be added, then clear its values, and reuse
  • If it is a GenericContainer and thus has a schema, then the schema is the same
    If we can't reuse the supplied value, then generate an appropriate collection, using the optimised values where we can

Updated the documentation, and added tests

Verifying this change

This change added tests and can be verified as follows:

  • Added unit tests to ensure that appropriate values are returned (as described above)

Documentation

  • Does this pull request introduce a new feature? (no)

only return an appropriate array
@github-actions github-actions bot added the Java Pull Requests for Java binding label Feb 6, 2025
@mkeskells
Copy link
Contributor Author

related issue - https://issues.apache.org/jira/browse/AVRO-4039

Mike Skells added 3 commits February 7, 2025 15:46
only return an appropriate array
fix import that spotless removed
review feedback
remove schema check on returned value
Check convertors with logical types
review feedback
@opwvhk
Copy link
Contributor

opwvhk commented Mar 14, 2025

Hi @mkeskells,
Looks good!
Can you please push the commit with these last "removed"/"done" fixes?

review feedback
@mkeskells
Copy link
Contributor Author

Hi @mkeskells, Looks good! Can you please push the commit with these last "removed"/"done" fixes?

doh

pushed now

@mkeskells
Copy link
Contributor Author

@opwvhk What's the process from here to get this merged? Does it need other reviewers to approve etc?
I don't know the processes that apply here for this project

@mkeskells
Copy link
Contributor Author

Hi
What's the process to get this merged?

@jasmdk
Copy link

jasmdk commented Apr 11, 2025

@mkeskells it seems like it can be merged now. I am also waiting for this fix as it blocks us from upgrading Quarkus beyond version 3.13

@mkeskells
Copy link
Contributor Author

@jasmdk I don't have permission to merge. I don't know who is the appropriate maintainer who can merge this

@opwvhk
Copy link
Contributor

opwvhk commented May 3, 2025

Hi @mskells,
Sorry it took me so long to get back on this. The official way to get a PR merged into an Apache project is an approval by consensus voting (i.e., at least 3 binding +1 votes), but for Avro we're usually more lenient (2 positive reviews by committers and/or PMCs is what we usually deem sufficient).

As it stands now, I propose to merge this next week unless there's any objection.

@martin-g
Copy link
Member

martin-g commented May 3, 2025

@opwvhk There is no such rule (3 approvals) at Apache. Maybe you are confused with the release votes.

If you feel confident that a change is good then feel free to merge it!

@opwvhk
Copy link
Contributor

opwvhk commented May 4, 2025

@opwvhk There is no such rule (3 approvals) at Apache. Maybe you are confused with the release votes.

That's possible, though it would be a misinterpretation of what code modification votes are for, not package releases.

If you feel confident that a change is good then feel free to merge it!

👍 Let's take this as the Avro way then. It's also more convenient for me.

@opwvhk opwvhk merged commit 09277d0 into apache:main May 6, 2025
8 checks passed
opwvhk pushed a commit that referenced this pull request Jun 13, 2025
…te array implementation (#3307)

* AVRO-4039 fix GenericData.newArray
only return an appropriate array

* AVRO-4039 fix GenericData.newArray
only return an appropriate array

* AVRO-4039 fix GenericData.newArray
spotless

* AVRO-4039
fix import that spotless removed

* AVRO-4039
review feedback
remove schema check on returned value
Check convertors with logical types

* AVRO-4039
review feedback

* AVRO-4039
review feedback

(cherry picked from commit 09277d0)
opwvhk pushed a commit to opwvhk/avro that referenced this pull request Sep 5, 2025
…te array implementation (apache#3307)

* AVRO-4039 fix GenericData.newArray
only return an appropriate array

* AVRO-4039 fix GenericData.newArray
only return an appropriate array

* AVRO-4039 fix GenericData.newArray
spotless

* AVRO-4039
fix import that spotless removed

* AVRO-4039
review feedback
remove schema check on returned value
Check convertors with logical types

* AVRO-4039
review feedback

* AVRO-4039
review feedback
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.

5 participants