Skip to content

[Java] arrow-vector 16.1.0 has a change that breaks Java 8 support #41717

Closed

Description

@pjfanning

Describe the bug, including details regarding any error messages, version, and platform.

arrow-vector 16.0.0 works fine for us but upgrading to 16.1.0 causes compile issues for us when we build with Java 8.

We found this in the Apache Pekko CI build.

[info] org.apache.pekko.stream.connectors.googlecloud.bigquery.storage.scaladsl.BigQueryArrowStorageSpec *** ABORTED *** (0 milliseconds)
[info]   java.lang.NoSuchMethodError: java.nio.ByteBuffer.rewind()Ljava/nio/ByteBuffer;
[info]   at org.apache.arrow.vector.ipc.message.MessageSerializer.readMessage(MessageSerializer.java:704)
[info]   at org.apache.arrow.vector.ipc.message.MessageSerializer.deserializeSchema(MessageSerializer.java:213)
[info]   at org.apache.pekko.stream.connectors.googlecloud.bigquery.storage.impl.SimpleRowReader.<init>(ArrowSource.scala:66)
[info]   at org.apache.pekko.stream.connectors.googlecloud.bigquery.storage.scaladsl.BigQueryArrowStorageSpec.$anonfun$new$1(BigQueryArrowStorageSpec.scala:35)

Component(s)

Java

Activity

  1. pjfanning commented on May 19, 2024

    @pjfanning
    MemberAuthor

    ByteBuffer inherits rewind from Buffer and Java 8 has this method.

    https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html#rewind--

    I have seem issues in Java 8 where you need to cast to java.nio.Buffer for this to work reliably.

    In https://issues.apache.org/jira/browse/HADOOP-18197, there were issues where we got on some Java8 installations.

    java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
    

    We had to upgrade protobuf-java (which had the ByteBuffer code that was causing us issues) to get this fix:
    protocolbuffers/protobuf@d40aadf

    See https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/

  2. pjfanning commented on May 19, 2024

    @pjfanning
    MemberAuthor

    Arrow has this cast in a different part of the code.

    ((ByteBuffer) ((Buffer) reader).rewind()).get(bytes);

    Could we add a similar cast in the method that is causing issues?

  3. changed the title [-]arrow-vector 16.1.0 has a change that breaks Java 8 support[/-] [+][Java] arrow-vector 16.1.0 has a change that breaks Java 8 support[/+] on May 19, 2024
  4. assignUser commented on May 19, 2024

    @assignUser
    Member

    fyi: #38051

  5. added a commit that references this issue on May 20, 2024
  6. added a commit that references this issue on May 20, 2024
  7. added this to the 17.0.0 milestone on May 20, 2024
  8. lidavidm commented on May 20, 2024

    @lidavidm
    Member

    Issue resolved by pull request 41718
    #41718

  9. pjfanning commented on May 20, 2024

    @pjfanning
    MemberAuthor
  10. lidavidm commented on May 20, 2024

    @lidavidm
    Member
  11. added a commit that references this issue on May 25, 2024
  12. added a commit that references this issue on Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions