@@ -19,6 +19,7 @@ package org.apache.spark.sql.execution.joins
1919
2020import org .apache .spark .sql .catalyst .planning .ExtractEquiJoinKeys
2121import org .apache .spark .sql .catalyst .plans .logical .Join
22+ import org .apache .spark .sql .types .{IntegerType , DoubleType , StructType }
2223import org .apache .spark .sql .{DataFrame , Row }
2324import org .apache .spark .sql .catalyst .expressions ._
2425import org .apache .spark .sql .catalyst .plans ._
@@ -69,17 +70,19 @@ class OuterJoinSuite extends SparkPlanTest {
6970 }
7071 }
7172
72- val left = Seq (
73- (1 , 2.0 ),
74- (2 , 1.0 ),
75- (3 , 3.0 )
76- ).toDF(" a" , " b" )
73+ val left = sqlContext.createDataFrame(sqlContext.sparkContext.parallelize(Seq (
74+ Row (1 , 2.0 ),
75+ Row (2 , 1.0 ),
76+ Row (3 , 3.0 ),
77+ Row (null , null )
78+ )), new StructType ().add(" a" , IntegerType ).add(" b" , DoubleType ))
7779
78- val right = Seq (
79- (2 , 3.0 ),
80- (3 , 2.0 ),
81- (4 , 1.0 )
82- ).toDF(" c" , " d" )
80+ val right = sqlContext.createDataFrame(sqlContext.sparkContext.parallelize(Seq (
81+ Row (2 , 3.0 ),
82+ Row (3 , 2.0 ),
83+ Row (4 , 1.0 ),
84+ Row (null , null )
85+ )), new StructType ().add(" c" , IntegerType ).add(" d" , DoubleType ))
8386
8487 val condition = {
8588 And (
@@ -98,7 +101,8 @@ class OuterJoinSuite extends SparkPlanTest {
98101 Seq (
99102 (1 , 2.0 , null , null ),
100103 (2 , 1.0 , 2 , 3.0 ),
101- (3 , 3.0 , null , null )
104+ (3 , 3.0 , null , null ),
105+ (null , null , null , null )
102106 )
103107 )
104108
@@ -111,7 +115,8 @@ class OuterJoinSuite extends SparkPlanTest {
111115 Seq (
112116 (2 , 1.0 , 2 , 3.0 ),
113117 (null , null , 3 , 2.0 ),
114- (null , null , 4 , 1.0 )
118+ (null , null , 4 , 1.0 ),
119+ (null , null , null , null )
115120 )
116121 )
117122
@@ -126,7 +131,9 @@ class OuterJoinSuite extends SparkPlanTest {
126131 (2 , 1.0 , 2 , 3.0 ),
127132 (3 , 3.0 , null , null ),
128133 (null , null , 3 , 2.0 ),
129- (null , null , 4 , 1.0 )
134+ (null , null , 4 , 1.0 ),
135+ (null , null , null , null ),
136+ (null , null , null , null )
130137 )
131138 )
132139
0 commit comments