You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/18 20:16:14 UTC

[GitHub] [spark] imback82 commented on a change in pull request #31545: [SPARK-34417] [SQL] org.apache.spark.sql.DataFrameNaFunctions.fillMap(values: Seq[(String, Any)]) fails for column name having a dot

imback82 commented on a change in pull request #31545:
URL: https://github.com/apache/spark/pull/31545#discussion_r578717656



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/DataFrameNaFunctions.scala
##########
@@ -394,10 +395,11 @@ final class DataFrameNaFunctions private[sql](df: DataFrame) {
   }
 
   private def fillMap(values: Seq[(String, Any)]): DataFrame = {
+    val resolved = mutable.Map[String, Any]()

Review comment:
       instead of having mutable map, you can just do the following:
   ```scala
   val resolved = values.map { case (colName, replaceValue) =>
     ...
     ...
     (resolvedColumn.name, replaceValue)
   }  
   ```




----------------------------------------------------------------
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



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