You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2024/12/03 06:37:59 UTC
(spark) branch master updated: [SPARK-50430][CORE][FOLLOW-UP] Keep the logic of manual putting key and values in Properties
This is an automated email from the ASF dual-hosted git repository.
gurwls223 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 4abaab3ffeba [SPARK-50430][CORE][FOLLOW-UP] Keep the logic of manual putting key and values in Properties
4abaab3ffeba is described below
commit 4abaab3ffeba5a3d39216e7224928bb82b254e22
Author: Hyukjin Kwon <gu...@apache.org>
AuthorDate: Tue Dec 3 15:37:43 2024 +0900
[SPARK-50430][CORE][FOLLOW-UP] Keep the logic of manual putting key and values in Properties
### What changes were proposed in this pull request?
This PR proposes to actually more conservatively preserve the original code of creating new properties instead of cloning.
### Why are the changes needed?
Previous codes only copied the key and values but `clone` actually copies more fields in `Properties`. `cloneProperties` is being used in Spark Core, and all other components so I propose to keep the logic as is.
### Does this PR introduce _any_ user-facing change?
This is more a fix of a potential bug.
### How was this patch tested?
No, it is difficult to add a test.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #49036 from HyukjinKwon/SPARK-50430-followup.
Authored-by: Hyukjin Kwon <gu...@apache.org>
Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
core/src/main/scala/org/apache/spark/util/Utils.scala | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala
index 109db36d4069..b2cf99241fde 100644
--- a/core/src/main/scala/org/apache/spark/util/Utils.scala
+++ b/core/src/main/scala/org/apache/spark/util/Utils.scala
@@ -2982,7 +2982,9 @@ private[spark] object Utils
if (props == null) {
return props
}
- props.clone().asInstanceOf[Properties]
+ val resultProps = new Properties()
+ resultProps.putAll(props.clone().asInstanceOf[Properties])
+ resultProps
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org