Skip to content

Commit

Permalink
[SPARK-50430][CORE][FOLLOW-UP] Keep the logic of manual putting key a…
Browse files Browse the repository at this point in the history
…nd 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 apache#49036 from HyukjinKwon/SPARK-50430-followup.

Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
  • Loading branch information
HyukjinKwon committed Dec 3, 2024
1 parent 2041519 commit 4abaab3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down

0 comments on commit 4abaab3

Please sign in to comment.