spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] mccheah commented on a change in pull request #26738: [SPARK-30082] Do not replace Zeros when replacing NaNs
Date Mon, 02 Dec 2019 21:28:25 GMT
mccheah commented on a change in pull request #26738: [SPARK-30082] Do not replace Zeros when
replacing NaNs
URL: https://github.com/apache/spark/pull/26738#discussion_r352867265
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/DataFrameNaFunctions.scala
 ##########
 @@ -456,11 +456,25 @@ 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))
+        if (!(checkIfNonFractionalNumeric(col.dataType) &&
 
 Review comment:
   You could do `col.dataType match` instead of the separate function with the long boolean
expression there. I think that's more idiomatic to Scala and in the context of this part of
the code.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message