I can say that in Spark 2.2.0 and Scala 2.11.8 there were no problems with the same example as I do not get an exception when using the same code example with zero safe
<=>
and equal operator
===
Try again and add more information related to the problem?
val d1 = sc.parallelize(Seq(
(null, 1), ("a1",2))
).toDF("a", "b")
d1.show
+----+---+
| a| b|
+----+---+
|null| 1|
| a1| 2|
+----+---+
val d2 = sc.parallelize(Seq(
("a2",3))
).toDF("a", "b")
d2.show
+---+---+
| a| b|
+---+---+
| a2| 3|
+---+---+
d1.joinWith(d2, d1("a") <=> d2("a"), "left_outer").show()
+--------+----+
| _1| _2|
+--------+----+
|[null,1]|null|
| [a1,2]|null|
+--------+----+
d1.joinWith(d2, d1("a") === d2("a"), "left_outer").show()
+--------+----+
| _1| _2|
+--------+----+
|[null,1]|null|
| [a1,2]|null|
+--------+----+
Adding another example:
val x = Seq((100L,null), (102L,"17179869185L"), (101L,"17179869186L"), (200L,"17179869186L"), (401L,"1L"), (500L,"1L"), (600L,"8589934593L"), (700L,"8589934593L"), (800L,"8589934593L"), (900L,"8589934594L"), (1000L,"8589934594L"), (1200L,"2L"), (1300L,"2L"), (1301L,"2L"), (1400L,"17179869187L"), (1500L,"17179869188L"), (1600L,"8589934595L")).toDF("u","x1")
x.show()
+----+------------+
| u| x1|
+----+------------+
| 100| null|
| 102|17179869185L|
| 101|17179869186L|
| 200|17179869186L|
| 401| 1L|
| 500| 1L|
| 600| 8589934593L|
| 700| 8589934593L|
| 800| 8589934593L|
| 900| 8589934594L|
|1000| 8589934594L|
|1200| 2L|
|1300| 2L|
|1301| 2L|
|1400|17179869187L|
|1500|17179869188L|
|1600| 8589934595L|
+----+------------+
val y = Seq(("17179869187L",-8589934595L), ("17179869188L",-8589934595L), ("17179869185L",-858993
4593L)).toDF("x2","y")
y.show()
+------------+-----------+
| x2| y|
+------------+-----------+
|17179869187L|-8589934595|
|17179869188L|-8589934595|
|17179869185L|-8589934593|
+------------+-----------+
x.join(y,'x1 === 'x2, "left_outer").show()
+----+------------+------------+-----------+
| u| x1| x2| y|
+----+------------+------------+-----------+
| 100| null| null| null|
| 102|17179869185L|17179869185L|-8589934593|
| 101|17179869186L| null| null|
| 200|17179869186L| null| null|
| 401| 1L| null| null|
| 500| 1L| null| null|
| 600| 8589934593L| null| null|
| 700| 8589934593L| null| null|
| 800| 8589934593L| null| null|
| 900| 8589934594L| null| null|
|1000| 8589934594L| null| null|
|1200| 2L| null| null|
|1300| 2L| null| null|
|1301| 2L| null| null|
|1400|17179869187L|17179869187L|-8589934595|
|1500|17179869188L|17179869188L|-8589934595|
|1600| 8589934595L| null| null|
+----+------------+------------+-----------+
x: org.apache.spark.sql.DataFrame = [u: bigint, x1: string]
y: org.apache.spark.sql.DataFrame = [x2: string, y: bigint]
Command took 1.00 second