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

    https://github.com/apache/spark/pull/15409#discussion_r83050677
  
    --- Diff: python/pyspark/sql/dataframe.py ---
    @@ -640,25 +640,24 @@ def join(self, other, on=None, how=None):
             if on is not None and not isinstance(on, list):
                 on = [on]
     
    -        if on is None or len(on) == 0:
    -            jdf = self._jdf.crossJoin(other._jdf)
    -        elif isinstance(on[0], basestring):
    -            if how is None:
    -                jdf = self._jdf.join(other._jdf, self._jseq(on), "inner")
    +        if on is not None:
    +            if isinstance(on[0], basestring):
    +                on = self._jseq(on)
                 else:
    -                assert isinstance(how, basestring), "how should be 
basestring"
    -                jdf = self._jdf.join(other._jdf, self._jseq(on), how)
    +                assert isinstance(on[0], Column), "on should be Column or 
list of Column"
    +                if len(on) > 1:
    +                    on = reduce(lambda x, y: x.__and__(y), on)
    --- End diff --
    
    Wouldn't reduce work even if len(on) == 1. i.e. do you need an if here ?


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

Reply via email to