Skip to content

Commit 42286fe

Browse files
gatorsmiledavies
authored andcommitted
[SPARK-12520] [PYSPARK] [1.5] Ensure the join type is inner for equi-Join.
This PR is to add `assert` to ensure the join type is `inner` for equi-Join. JIRA: https://issues.apache.org/jira/browse/SPARK-12520 In the JIRA, users specify the join type `outer` when using the equi-join. However, the result we returned is the `inner` join, which is the only type Spark 1.5 supports. (Note, starting from Spark 1.6, we can support the other types for equi-join). For example, ```scala joined_table = left_table.join(right_table, "joining_column", "outer") ``` Should we also back port it to 1.4? davies JoshRosen Thanks! Author: gatorsmile <gatorsmile@gmail.com> Closes apache#10484 from gatorsmile/pythonEquiOuterJoin.
1 parent 86161a4 commit 42286fe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

python/pyspark/sql/dataframe.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ def join(self, other, on=None, how=None):
570570
if on is None or len(on) == 0:
571571
jdf = self._jdf.join(other._jdf)
572572
elif isinstance(on[0], basestring):
573+
assert how is None or how == 'inner', "Equi-join does not support: %s" % how
573574
jdf = self._jdf.join(other._jdf, self._jseq(on))
574575
else:
575576
assert isinstance(on[0], Column), "on should be Column or list of Column"

0 commit comments

Comments
 (0)