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/09/02 02:58:19 UTC

[GitHub] [spark] liangz1 commented on a change in pull request #33853: [SPARK-36642][SQL] Add df.withMetadata: a syntax suger to update the metadata of a dataframe

liangz1 commented on a change in pull request #33853:
URL: https://github.com/apache/spark/pull/33853#discussion_r700706967



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
##########
@@ -2491,6 +2491,16 @@ class Dataset[T] private[sql](
     }
   }
 
+  /**
+   * Returns a new Dataset by updating an existing column with metadata.
+   *
+   * @group untypedrel
+   * @since 3.3.0
+   */
+  def withMetadata(columnName: String, metadata: Metadata): DataFrame = {

Review comment:
       That would also work, but I prefer the current shorter version, since the first param requires a column name, it's not likely for the users to be confused about whether the metadata is for a column or something else. Also, since this is syntax sugar, a shorter name would better justify the new API.




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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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