Skip to content

Commit c00fe04

Browse files
committed
updated to include all joins, make them consistent
1 parent cd1d00a commit c00fe04

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

R/pkg/R/DataFrame.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2314,8 +2314,9 @@ setMethod("dropDuplicates",
23142314
#' Column expression. If joinExpr is omitted, the default, inner join is attempted and an error is
23152315
#' thrown if it would be a Cartesian Product. For Cartesian join, use crossJoin instead.
23162316
#' @param joinType The type of join to perform. The following join types are available:
2317-
#' 'inner', 'outer', 'full', 'fullouter', leftouter', 'left_outer', 'left',
2318-
#' 'right_outer', 'rightouter', 'right', and 'leftsemi'. The default joinType is "inner".
2317+
#' 'inner', 'cross', 'outer', 'full', 'full_outer', 'left', 'left_outer',
2318+
#' 'right', 'right_outer', 'left_semi', 'left_anti', 'cross'.
2319+
#' and 'cross'. The default joinType is "inner".
23192320
#' @return A SparkDataFrame containing the result of the join operation.
23202321
#' @family SparkDataFrame functions
23212322
#' @aliases join,SparkDataFrame,SparkDataFrame-method

python/pyspark/sql/dataframe.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,9 @@ def join(self, other, on=None, how=None):
730730
a join expression (Column), or a list of Columns.
731731
If `on` is a string or a list of strings indicating the name of the join column(s),
732732
the column(s) must exist on both sides, and this performs an equi-join.
733-
:param how: str, default 'inner'.
734-
One of `inner`, `outer`, `left_outer`, `right_outer`, `leftsemi`.
733+
:param how: str, default 'inner'. Can be any of: `inner`, `cross`, `outer`,
734+
`full`, `full_outer`, `left`, `left_outer`, `right`, `right_outer`,
735+
`left_semi`, `left_anti`, `cross`.
735736
736737
The following performs a full outer join between ``df1`` and ``df2``.
737738

sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,14 +750,17 @@ class Dataset[T] private[sql](
750750
}
751751

752752
/**
753-
* Equi-join with another `DataFrame` using the given columns.
753+
* Equi-join with another `DataFrame` using the given columns. A cross join with a predicate
754+
* is specified as an inner join. If you would explicitly like to perform a cross join use the
755+
* `crossJoin` method.
754756
*
755757
* Different from other join functions, the join columns will only appear once in the output,
756758
* i.e. similar to SQL's `JOIN USING` syntax.
757759
*
758760
* @param right Right side of the join operation.
759761
* @param usingColumns Names of the columns to join on. This columns must exist on both sides.
760-
* @param joinType One of: `inner`, `outer`, `left_outer`, `right_outer`, `leftsemi`.
762+
* @param joinType One of: `inner`, `cross`, `outer`, `full`, `full_outer`,
763+
* `left`, `left_outer`, `right`, `right_outer`, `left_semi`, `left_anti`.
761764
*
762765
* @note If you perform a self-join using this function without aliasing the input
763766
* `DataFrame`s, you will NOT be able to reference any columns after the join, since
@@ -812,7 +815,8 @@ class Dataset[T] private[sql](
812815
*
813816
* @param right Right side of the join.
814817
* @param joinExprs Join expression.
815-
* @param joinType One of: `inner`, `outer`, `left_outer`, `right_outer`, `leftsemi`.
818+
* @param joinType One of: `inner`, `cross`, `outer`, `full`, `full_outer`,
819+
* `left`, `left_outer`, `right`, `right_outer`, `left_semi`, `left_anti`.
816820
*
817821
* @group untypedrel
818822
* @since 2.0.0
@@ -889,7 +893,8 @@ class Dataset[T] private[sql](
889893
*
890894
* @param other Right side of the join.
891895
* @param condition Join expression.
892-
* @param joinType One of: `inner`, `outer`, `left_outer`, `right_outer`, `leftsemi`.
896+
* @param joinType One of: `inner`, `cross`, `outer`, `full`, `full_outer`,
897+
* `left`, `left_outer`, `right`, `right_outer`, `left_semi`, `left_anti`.
893898
*
894899
* @group typedrel
895900
* @since 1.6.0

0 commit comments

Comments
 (0)