@@ -4,27 +4,16 @@ import java.util
4
4
import frameless .functions .CatalystExplodableCollection
5
5
import frameless .ops ._
6
6
import org .apache .spark .rdd .RDD
7
- import org .apache .spark .sql .{ Column , DataFrame , Dataset , SparkSession }
8
- import org .apache .spark .sql .catalyst .expressions .{
9
- Attribute ,
10
- AttributeReference ,
11
- Literal
12
- }
13
- import org .apache .spark .sql .catalyst .plans .logical .{ Join , JoinHint }
7
+ import org .apache .spark .sql .{Column , DataFrame , Dataset , ShimUtils , SparkSession }
8
+ import org .apache .spark .sql .catalyst .expressions .{Attribute , AttributeReference , Literal }
9
+ import org .apache .spark .sql .catalyst .plans .logical .{Join , JoinHint }
14
10
import org .apache .spark .sql .catalyst .plans .Inner
15
11
import org .apache .spark .sql .ShimUtils .column
16
12
import org .apache .spark .sql .types .StructType
17
13
import shapeless ._
18
14
import shapeless .labelled .FieldType
19
- import shapeless .ops .hlist .{
20
- Diff ,
21
- IsHCons ,
22
- Mapper ,
23
- Prepend ,
24
- ToTraversable ,
25
- Tupler
26
- }
27
- import shapeless .ops .record .{ Keys , Modifier , Remover , Values }
15
+ import shapeless .ops .hlist .{Diff , IsHCons , Mapper , Prepend , ToTraversable , Tupler }
16
+ import shapeless .ops .record .{Keys , Modifier , Remover , Values }
28
17
29
18
import scala .language .experimental .macros
30
19
@@ -767,7 +756,8 @@ class TypedDataset[T] protected[frameless] (
767
756
e : TypedEncoder [(T , U )]
768
757
): TypedDataset [(T , U )] =
769
758
new TypedDataset (
770
- self.dataset.joinWith(other.dataset, column(Literal (true )), " cross" )
759
+ ShimUtils .joinWith(dataset, other.dataset, column(Literal (true )), " cross" )(TypedExpressionEncoder [(T , U )])
760
+ // self.dataset.joinWith(other.dataset, column(Literal(true)), "cross")
771
761
)
772
762
773
763
/**
@@ -778,14 +768,17 @@ class TypedDataset[T] protected[frameless] (
778
768
other : TypedDataset [U ]
779
769
)(condition : TypedColumn [T with U , Boolean ]
780
770
)(implicit
781
- e : TypedEncoder [(Option [T ], Option [U ])]
771
+ e : TypedEncoder [(Option [T ], Option [U ])],
772
+ to : TypedEncoder [(T , U )]
782
773
): TypedDataset [(Option [T ], Option [U ])] =
783
774
new TypedDataset (
784
- self.dataset
775
+ ShimUtils .joinWith(dataset, other.dataset, condition.untyped, " full" )(TypedExpressionEncoder [(T , U )])
776
+ .as[(Option [T ], Option [U ])](TypedExpressionEncoder [(Option [T ], Option [U ])])
777
+ /* self.dataset
785
778
.joinWith(other.dataset, condition.untyped, "full")
786
779
.as[(Option[T], Option[U])](
787
780
TypedExpressionEncoder[(Option[T], Option[U])]
788
- )
781
+ )*/
789
782
)
790
783
791
784
/**
@@ -820,12 +813,15 @@ class TypedDataset[T] protected[frameless] (
820
813
other : TypedDataset [U ]
821
814
)(condition : TypedColumn [T with U , Boolean ]
822
815
)(implicit
823
- e : TypedEncoder [(T , Option [U ])]
816
+ e : TypedEncoder [(T , Option [U ])],
817
+ to : TypedEncoder [(T , U )]
824
818
): TypedDataset [(T , Option [U ])] =
825
819
new TypedDataset (
826
- self.dataset
827
- .joinWith(other.dataset, condition.untyped, " left_outer" )
820
+ ShimUtils .joinWith(dataset, other.dataset, condition.untyped, " left_outer" )(TypedExpressionEncoder [(T , U )])
828
821
.as[(T , Option [U ])](TypedExpressionEncoder [(T , Option [U ])])
822
+ /* self.dataset
823
+ .joinWith(other.dataset, condition.untyped, "left_outer")
824
+ .as[(T, Option[U])](TypedExpressionEncoder[(T, Option[U])])*/
829
825
)
830
826
831
827
/**
@@ -864,12 +860,15 @@ class TypedDataset[T] protected[frameless] (
864
860
other : TypedDataset [U ]
865
861
)(condition : TypedColumn [T with U , Boolean ]
866
862
)(implicit
867
- e : TypedEncoder [(Option [T ], U )]
863
+ e : TypedEncoder [(Option [T ], U )],
864
+ to : TypedEncoder [(T , U )]
868
865
): TypedDataset [(Option [T ], U )] =
869
866
new TypedDataset (
870
- self.dataset
871
- .joinWith(other.dataset, condition.untyped, " right_outer" )
867
+ ShimUtils .joinWith( self.dataset, other.dataset, condition.untyped, " right_outer" )(TypedExpressionEncoder [(T , U )])
872
868
.as[(Option [T ], U )](TypedExpressionEncoder [(Option [T ], U )])
869
+ /* self.dataset
870
+ .joinWith(other.dataset, condition.untyped, "right_outer")
871
+ .as[(Option[T], U)](TypedExpressionEncoder[(Option[T], U)])*/
873
872
)
874
873
875
874
private def disambiguate (join : Join ): Join = {
0 commit comments