You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2026/04/16 21:33:51 UTC
(spark) branch master updated: [SPARK-56495][CONNECT] Remove `CountingOutputStream` overhead from `SparkConnectAddArtifactsHandler`
This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 4e72933896a2 [SPARK-56495][CONNECT] Remove `CountingOutputStream` overhead from `SparkConnectAddArtifactsHandler`
4e72933896a2 is described below
commit 4e72933896a23cc1f532e7d44b74bcebda5ad714
Author: Dongjoon Hyun <do...@apache.org>
AuthorDate: Thu Apr 16 14:33:40 2026 -0700
[SPARK-56495][CONNECT] Remove `CountingOutputStream` overhead from `SparkConnectAddArtifactsHandler`
### What changes were proposed in this pull request?
This PR removes the unused `CountingOutputStream` (from Google Guava) in `SparkConnectAddArtifactsHandler`. The `countingOut` variable was wrapping the file output stream but its count was never read anywhere. The `CheckedOutputStream` now wraps `fileOut` directly.
### Why are the changes needed?
The `CountingOutputStream` adds an unnecessary dependency on Google Guava and an extra layer in the output stream chain without being used. Removing it simplifies the code.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-6)
Closes #55359 from dongjoon-hyun/SPARK-56495.
Authored-by: Dongjoon Hyun <do...@apache.org>
Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
.../spark/sql/connect/service/SparkConnectAddArtifactsHandler.scala | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAddArtifactsHandler.scala b/sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAddArtifactsHandler.scala
index 477d5b974fac..78970b747956 100644
--- a/sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAddArtifactsHandler.scala
+++ b/sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAddArtifactsHandler.scala
@@ -23,7 +23,6 @@ import java.util.zip.{CheckedOutputStream, CRC32}
import scala.collection.mutable
import scala.util.control.NonFatal
-import com.google.common.io.CountingOutputStream
import io.grpc.stub.StreamObserver
import org.apache.spark.SparkRuntimeException
@@ -228,8 +227,7 @@ class SparkConnectAddArtifactsHandler(val responseObserver: StreamObserver[AddAr
Files.createDirectories(stagedPath.getParent)
private val fileOut = Files.newOutputStream(stagedPath)
- private val countingOut = new CountingOutputStream(fileOut)
- private val checksumOut = new CheckedOutputStream(countingOut, new CRC32)
+ private val checksumOut = new CheckedOutputStream(fileOut, new CRC32)
private val overallChecksum = new CRC32()
private val builder = ArtifactSummary.newBuilder().setName(name)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org