cloud-fan commented on a change in pull request #26738: [SPARK-30082][SQL] Do 
not replace Zeros when replacing NaNs
URL: https://github.com/apache/spark/pull/26738#discussion_r361891660
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/DataFrameNaFunctions.scala
 ##########
 @@ -456,7 +456,7 @@ final class DataFrameNaFunctions private[sql](df: 
DataFrame) {
     val keyExpr = df.col(col.name).expr
     def buildExpr(v: Any) = Cast(Literal(v), keyExpr.dataType)
     val branches = replacementMap.flatMap { case (source, target) =>
-      Seq(buildExpr(source), buildExpr(target))
+      Seq(Literal(source), buildExpr(target))
 
 Review comment:
   The new behavior makes more sense, but I agree that the PR description needs 
update to reflect all the changes. cc @johnhany97 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to