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



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/DataFrameNaFunctions.scala
##########
@@ -406,11 +408,18 @@ final class DataFrameNaFunctions private[sql](df: 
DataFrame) {
         case _ => throw new IllegalArgumentException(
           s"Unsupported value type ${replaceValue.getClass.getName} 
($replaceValue).")
       }
+      resolved += (resolvedColumn.name -> replaceValue)
+      // Use resolved column name onwards for filling the null values.
+      // It is needed for the column names having a dot and quoted with 
back-tick.
+      // Eg: "`ColWith.Dot`" will be resolved to the column with name 
"ColWith.Dot"
+      // in a dataframe having columns ("ColWith.Dot", "Col").
+      // If resolved name is not used, while filling null values 
"`ColWith.Dot`" will
+      // not match "ColWith.Dot".

Review comment:
       Usually put the comment before the code you want to comment?
   
   ```
   // Use resolved column name onwards for filling the null
   // ...
   resolved += (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:
us...@infra.apache.org



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

Reply via email to