Github user dongjoon-hyun commented on a diff in the pull request: https://github.com/apache/spark/pull/13545#discussion_r66156310 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala --- @@ -2262,6 +2275,19 @@ class Dataset[T] private[sql]( def distinct(): Dataset[T] = dropDuplicates() /** + * Returns a new [[Dataset]] that contains only the unique rows from this [[Dataset]], considering + * only the subset of columns. This is an alias for `dropDuplicates(cols)`. + * + * Note that, equality checking is performed directly on the encoded representation of the data + * and thus is not affected by a custom `equals` function defined on `T`. + * + * @group typedrel + * @since 2.0.0 + */ + @scala.annotation.varargs + def distinct(cols: String*): Dataset[T] = dropDuplicates(cols) --- End diff -- In addition, `distinct` of `dplyr` R packages works in the same manner.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org