imback82 commented on a change in pull request #26593: [SPARK-29890][SQL]
DataFrameNaFunctions.fill should handle duplicate columns
URL: https://github.com/apache/spark/pull/26593#discussion_r348680086
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/DataFrameNaFunctions.scala
##########
@@ -468,12 +477,21 @@ final class DataFrameNaFunctions private[sql](df:
DataFrame) {
s"Unsupported value type ${v.getClass.getName} ($v).")
}
+ private def toAttributes(cols: Seq[String]): Seq[Attribute] = {
+ cols.map(df.col(_).named.toAttribute)
+ }
+
+ private def outputAttributes: Seq[Attribute] = {
+ df.queryExecution.analyzed.output
+ }
+
/**
* Returns a new `DataFrame` that replaces null or NaN values in specified
* numeric, string columns. If a specified column is not a numeric, string
- * or boolean column it is ignored.
+ * or boolean column it is ignored. If `cols` is empty, fill() is applied to
+ * all the eligible columns.
Review comment:
forgot to update the comment. thanks for catching!
----------------------------------------------------------------
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]