amandeep-sharma commented on a change in pull request #31769:
URL: https://github.com/apache/spark/pull/31769#discussion_r589218756
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/DataFrameNaFunctions.scala
##########
@@ -359,6 +359,16 @@ final class DataFrameNaFunctions private[sql](df:
DataFrame) {
return df
}
+ val replaceableAttrs = AttributeSet(cols.map { colName =>
+ // Check column name exists
+ val attr = df.resolve(colName) match {
+ case a: Attribute => a
+ case _ => throw new UnsupportedOperationException(
+ s"Nested field ${colName} is not supported.")
Review comment:
`df.resolve` throws `org.apache.spark.sql.AnalysisException` with error
message `Cannot resolve column name "xxx" among (c0, c1)`, if any of the given
columns do not exist.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]