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/08/14 17:39:21 UTC
[GitHub] [spark] srowen commented on a change in pull request #33323: [SPARK-35739][SQL] Add Java-compatible Dataset.join overloads
srowen commented on a change in pull request #33323:
URL: https://github.com/apache/spark/pull/33323#discussion_r688972950
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
##########
@@ -970,7 +995,59 @@ class Dataset[T] private[sql](
}
/**
- * Equi-join with another `DataFrame` using the given columns. A cross join with a predicate
+ * Equi-join with another `DataFrame` using the given column. A cross join with a predicate
+ * is specified as an inner join. If you would explicitly like to perform a cross join use the
+ * `crossJoin` method.
+ *
+ * Different from other join functions, the join column will only appear once in the output,
+ * i.e. similar to SQL's `JOIN USING` syntax.
+ *
+ * @param right Right side of the join operation.
+ * @param usingColumn Name of the column to join on. This column must exist on both sides.
+ * @param joinType Type of join to perform. Default `inner`. Must be one of:
+ * `inner`, `cross`, `outer`, `full`, `fullouter`, `full_outer`, `left`,
+ * `leftouter`, `left_outer`, `right`, `rightouter`, `right_outer`,
+ * `semi`, `leftsemi`, `left_semi`, `anti`, `leftanti`, left_anti`.
+ *
+ * @note If you perform a self-join using this function without aliasing the input
+ * `DataFrame`s, you will NOT be able to reference any columns after the join, since
+ * there is no way to disambiguate which side of the join you would like to reference.
+ *
+ * @group untypedrel
+ * @since 3.3.0
+ */
+ def join(right: Dataset[_], usingColumn: String, joinType: String): DataFrame = {
+ join(right, Seq(usingColumn), joinType)
+ }
+
+ /**
+ * (Java-specific) Equi-join with another `DataFrame` using the given columns. A cross join with
Review comment:
I don't mind this at all but I'm also OK with just saying "see the Scala-specific overload' rather than duplicating docs. But I suppose we do this many places so w/e.
--
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