Skip to content

Commit

Permalink
[SPARK-50107][SQL][BUILD] Upgrade protobuf-java to 4.28.3
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

This PR aims to upgrade `protobuf-java` to 4.28.3 for Apache Spark 4.0.0 on February 2025.

### Why are the changes needed?

`protobuf-java` `4.28.3` is the latest version which is released two days ago (Oct 23, 2024).

https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java/4.28.3

This is a part of `v28.3`.
- https://github.com/protocolbuffers/protobuf/releases/tag/v28.3 (2024-10-22)

Note that `v26` introduced a breaking change to Java API last year.
- https://protobuf.dev/news/2023-12-05/#breaking-compatibility-with-old-generated-code

> v26.x will break compatibility with generated code from older major versions. Users should regenerate old generated code to be from the same version.
> For example, GeneratedMessageV3, which was originally introduced for backwards compatibility with generated code from v2.x.x against v3.x.x runtime, will be renamed to GeneratedMessage. Runtimes will be updated to support [Editions](https://protobuf.dev/editions/overview/), which will not be compatible with old generated code.

### Does this PR introduce _any_ user-facing change?

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#48646 from dongjoon-hyun/SPARK-50107.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
  • Loading branch information
dongjoon-hyun committed Oct 25, 2024
1 parent b0dc654 commit 250f8af
Show file tree
Hide file tree
Showing 4 changed files with 470 additions and 470 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<!-- make sure to update IsolatedClientLoader whenever this version is changed -->
<hadoop.version>3.4.1</hadoop.version>
<!-- SPARK-41247: When updating `protobuf.version`, also need to update `protoVersion` in `SparkBuild.scala` -->
<protobuf.version>3.25.5</protobuf.version>
<protobuf.version>4.28.3</protobuf.version>
<protoc-jar-maven-plugin.version>3.11.4</protoc-jar-maven-plugin.version>
<yarn.version>${hadoop.version}</yarn.version>
<zookeeper.version>3.9.2</zookeeper.version>
Expand Down
2 changes: 1 addition & 1 deletion project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ object BuildCommons {

// Google Protobuf version used for generating the protobuf.
// SPARK-41247: needs to be consistent with `protobuf.version` in `pom.xml`.
val protoVersion = "3.25.5"
val protoVersion = "4.28.3"
// GRPC version used for Spark Connect.
val grpcVersion = "1.62.2"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package org.apache.spark.sql.connect.client

import java.util.concurrent.atomic.AtomicBoolean

import com.google.protobuf.GeneratedMessageV3
import com.google.protobuf.GeneratedMessage
import io.grpc.{Status, StatusRuntimeException}
import io.grpc.stub.StreamObserver

Expand Down Expand Up @@ -59,7 +59,7 @@ class ResponseValidator extends Logging {
isSessionActive.getAcquire
}

def verifyResponse[RespT <: GeneratedMessageV3](fn: => RespT): RespT = {
def verifyResponse[RespT <: GeneratedMessage](fn: => RespT): RespT = {
val response =
try {
fn
Expand Down Expand Up @@ -100,7 +100,7 @@ class ResponseValidator extends Logging {
* Wraps an existing iterator with another closeable iterator that verifies the response. This
* is needed for server-side streaming calls that are converted to iterators.
*/
def wrapIterator[T <: GeneratedMessageV3, V <: CloseableIterator[T]](
def wrapIterator[T <: GeneratedMessage, V <: CloseableIterator[T]](
inner: V): WrappedCloseableIterator[T] = {
new WrappedCloseableIterator[T] {

Expand All @@ -118,7 +118,7 @@ class ResponseValidator extends Logging {
* Wraps an existing stream observer with another stream observer that verifies the response.
* This is necessary for client-side streaming calls.
*/
def wrapStreamObserver[T <: GeneratedMessageV3](inner: StreamObserver[T]): StreamObserver[T] = {
def wrapStreamObserver[T <: GeneratedMessage](inner: StreamObserver[T]): StreamObserver[T] = {
new StreamObserver[T] {
private val innerObserver = inner
override def onNext(value: T): Unit = {
Expand Down
Loading

0 comments on commit 250f8af

Please sign in to comment.