Skip to content

Conversation

@pan3793
Copy link
Member

@pan3793 pan3793 commented Nov 1, 2025

What changes were proposed in this pull request?

Fix sbt inconsistent shading package for spark-connect module

Why are the changes needed?

Take 4.1.0-preview3 as the example, which is built by Maven.

$ jar tf jars/spark-connect_2.13-4.1.0-preview3.jar | grep 'connect/grpc' | head
org/sparkproject/connect/grpc/
org/sparkproject/connect/grpc/inprocess/
org/sparkproject/connect/grpc/inprocess/InProcessTransport$InProcessStream$InProcessServerStream.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$2.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$InProcessStream$InProcessClientStream.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$SingleMessageProducer.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$6.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$1.class
org/sparkproject/connect/grpc/inprocess/InProcessSocketAddress.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$InProcessStream.class

the produced jar built by SBT has a different relocated package for grpc classes

$ jar tf jars/spark-connect_2.13-4.1.0-SNAPSHOT.jar | grep 'connect/grpc' | head
org/sparkproject/connect/grpc/
org/sparkproject/connect/grpc/io/
org/sparkproject/connect/grpc/io/grpc/
org/sparkproject/connect/grpc/io/grpc/Attributes$1.class
org/sparkproject/connect/grpc/io/grpc/Attributes$Builder.class
org/sparkproject/connect/grpc/io/grpc/Attributes$Key.class
org/sparkproject/connect/grpc/io/grpc/Attributes.class
org/sparkproject/connect/grpc/io/grpc/BinaryLog.class
org/sparkproject/connect/grpc/io/grpc/BindableService.class
org/sparkproject/connect/grpc/io/grpc/CallCredentials$MetadataApplier.class

Does this PR introduce any user-facing change?

No, so far I don't see such inconsistent causes real issue.

How was this patch tested?

Verified the output of dev/make-distribution.sh --sbt-enabled

jar tf jars/spark-connect_2.13-4.1.0-SNAPSHOT.jar | grep 'connect/grpc' | head
org/sparkproject/connect/grpc/
org/sparkproject/connect/grpc/Attributes$1.class
org/sparkproject/connect/grpc/Attributes$Builder.class
org/sparkproject/connect/grpc/Attributes$Key.class
org/sparkproject/connect/grpc/Attributes.class
org/sparkproject/connect/grpc/BinaryLog.class
org/sparkproject/connect/grpc/BindableService.class
org/sparkproject/connect/grpc/CallCredentials$MetadataApplier.class
org/sparkproject/connect/grpc/CallCredentials$RequestInfo.class
org/sparkproject/connect/grpc/CallCredentials.class

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

No.

@github-actions github-actions bot added the BUILD label Nov 1, 2025
@LuciferYang
Copy link
Contributor

Which version should we start with to fix this issue? branch-4.0 or branch-3.5? @pan3793

@pan3793
Copy link
Member Author

pan3793 commented Nov 3, 2025

@LuciferYang the inconsistency exists since the SPARK-40448 (3.4.0), so it also applicable to branch-3.5.

But as mentioned in the PR description

so far I don't see such inconsistent causes real issue.

backport is optional

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you, @pan3793 and @LuciferYang .

Merged to master/4.1 for Apache Spark 4.1.0.

dongjoon-hyun pushed a commit that referenced this pull request Nov 3, 2025
### What changes were proposed in this pull request?

Fix sbt inconsistent shading package for `spark-connect` module

### Why are the changes needed?

Take 4.1.0-preview3 as the example, which is built by Maven.
```
$ jar tf jars/spark-connect_2.13-4.1.0-preview3.jar | grep 'connect/grpc' | head
org/sparkproject/connect/grpc/
org/sparkproject/connect/grpc/inprocess/
org/sparkproject/connect/grpc/inprocess/InProcessTransport$InProcessStream$InProcessServerStream.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$2.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$InProcessStream$InProcessClientStream.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$SingleMessageProducer.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$6.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$1.class
org/sparkproject/connect/grpc/inprocess/InProcessSocketAddress.class
org/sparkproject/connect/grpc/inprocess/InProcessTransport$InProcessStream.class
```

the produced jar built by SBT has a different relocated package for grpc classes
```
$ jar tf jars/spark-connect_2.13-4.1.0-SNAPSHOT.jar | grep 'connect/grpc' | head
org/sparkproject/connect/grpc/
org/sparkproject/connect/grpc/io/
org/sparkproject/connect/grpc/io/grpc/
org/sparkproject/connect/grpc/io/grpc/Attributes$1.class
org/sparkproject/connect/grpc/io/grpc/Attributes$Builder.class
org/sparkproject/connect/grpc/io/grpc/Attributes$Key.class
org/sparkproject/connect/grpc/io/grpc/Attributes.class
org/sparkproject/connect/grpc/io/grpc/BinaryLog.class
org/sparkproject/connect/grpc/io/grpc/BindableService.class
org/sparkproject/connect/grpc/io/grpc/CallCredentials$MetadataApplier.class
```

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

No, so far I don't see such inconsistent causes real issue.

### How was this patch tested?

Verified the output of `dev/make-distribution.sh --sbt-enabled`

```
jar tf jars/spark-connect_2.13-4.1.0-SNAPSHOT.jar | grep 'connect/grpc' | head
org/sparkproject/connect/grpc/
org/sparkproject/connect/grpc/Attributes$1.class
org/sparkproject/connect/grpc/Attributes$Builder.class
org/sparkproject/connect/grpc/Attributes$Key.class
org/sparkproject/connect/grpc/Attributes.class
org/sparkproject/connect/grpc/BinaryLog.class
org/sparkproject/connect/grpc/BindableService.class
org/sparkproject/connect/grpc/CallCredentials$MetadataApplier.class
org/sparkproject/connect/grpc/CallCredentials$RequestInfo.class
org/sparkproject/connect/grpc/CallCredentials.class
```

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

No.

Closes #52825 from pan3793/SPARK-54127.

Authored-by: Cheng Pan <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 3d92bdf)
Signed-off-by: Dongjoon Hyun <[email protected]>
@dongjoon-hyun
Copy link
Member

Let's deliver this to Apache Spark 4.1.0 only for now. :)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants