Skip to content

Commit 0939730

Browse files
sarutakHyukjinKwon
authored andcommitted
[SPARK-32214][SQL] The type conversion function generated in makeFromJava for "other" type uses a wrong variable
### What changes were proposed in this pull request? This PR fixes an inconsistency in `EvaluatePython.makeFromJava`, which creates a type conversion function for some Java/Scala types. `other` is a type but it should actually pass `obj`: ```scala case other => (obj: Any) => nullSafeConvert(other)(PartialFunction.empty) ``` This does not change the output because it always returns `null` for unsupported datatypes. ### Why are the changes needed? To make the codes coherent, and consistent. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? No behaviour change. Closes apache#29029 from sarutak/fix-makeFromJava. Authored-by: Kousuke Saruta <[email protected]> Signed-off-by: HyukjinKwon <[email protected]> (cherry picked from commit 371b35d) Signed-off-by: HyukjinKwon <[email protected]>
1 parent 37dc51a commit 0939730

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/python/EvaluatePython.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ object EvaluatePython {
198198

199199
case udt: UserDefinedType[_] => makeFromJava(udt.sqlType)
200200

201-
case other => (obj: Any) => nullSafeConvert(other)(PartialFunction.empty)
201+
case other => (obj: Any) => nullSafeConvert(obj)(PartialFunction.empty)
202202
}
203203

204204
private def nullSafeConvert(input: Any)(f: PartialFunction[Any, Any]): Any = {

0 commit comments

Comments
 (0)