Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15559#discussion_r84223480
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -2285,23 +2285,23 @@ setMethod("dropDuplicates",
     #' @aliases join,SparkDataFrame,SparkDataFrame-method
     #' @rdname join
     #' @name join
    -#' @seealso \link{merge}
    +#' @seealso \link{merge} \link{crossJoin}
     #' @export
     #' @examples
     #'\dontrun{
     #' sparkR.session()
     #' df1 <- read.json(path)
     #' df2 <- read.json(path2)
    -#' join(df1, df2) # Performs a Cartesian
     #' join(df1, df2, df1$col1 == df2$col2) # Performs an inner join based on 
expression
     #' join(df1, df2, df1$col1 == df2$col2, "right_outer")
    +#' crossJoin(df1, df2) # Performs a Cartesian
     #' }
     #' @note join since 1.4.0
     setMethod("join",
               signature(x = "SparkDataFrame", y = "SparkDataFrame"),
               function(x, y, joinExpr = NULL, joinType = NULL) {
                 if (is.null(joinExpr)) {
    -              sdf <- callJMethod(x@sdf, "crossJoin", y@sdf)
    +              stop("use crossJoin for Cartesian join")
    --- End diff --
    
    this is actually not the behavior in Python/Scala.
    
    The behavior should be that users can still call join with any condition, 
but when it actually comes to an action, the planner checks whether this can be 
converted into a non-cartesian join (via predicates on top of the join).



---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to