55
55
public class EnumerableBatchNestedLoopJoin extends Join implements EnumerableRel {
56
56
57
57
private final ImmutableBitSet requiredColumns ;
58
+ private final @ Nullable Double originRowCount ;
58
59
protected EnumerableBatchNestedLoopJoin (
59
60
RelOptCluster cluster ,
60
61
RelTraitSet traits ,
@@ -63,18 +64,32 @@ protected EnumerableBatchNestedLoopJoin(
63
64
RexNode condition ,
64
65
Set <CorrelationId > variablesSet ,
65
66
ImmutableBitSet requiredColumns ,
66
- JoinRelType joinType ) {
67
+ JoinRelType joinType ,
68
+ @ Nullable Double originRowCount ) {
67
69
super (cluster , traits , ImmutableList .of (), left , right , condition , variablesSet , joinType );
68
70
this .requiredColumns = requiredColumns ;
71
+ this .originRowCount = originRowCount ;
69
72
}
70
73
74
+ @ Deprecated
71
75
public static EnumerableBatchNestedLoopJoin create (
72
76
RelNode left ,
73
77
RelNode right ,
74
78
RexNode condition ,
75
79
ImmutableBitSet requiredColumns ,
76
80
Set <CorrelationId > variablesSet ,
77
81
JoinRelType joinType ) {
82
+ return create (left , right , condition , requiredColumns , variablesSet , joinType , null );
83
+ }
84
+
85
+ public static EnumerableBatchNestedLoopJoin create (
86
+ RelNode left ,
87
+ RelNode right ,
88
+ RexNode condition ,
89
+ ImmutableBitSet requiredColumns ,
90
+ Set <CorrelationId > variablesSet ,
91
+ JoinRelType joinType ,
92
+ @ Nullable Double originRowCount ) {
78
93
final RelOptCluster cluster = left .getCluster ();
79
94
final RelMetadataQuery mq = cluster .getMetadataQuery ();
80
95
final RelTraitSet traitSet =
@@ -89,9 +104,11 @@ public static EnumerableBatchNestedLoopJoin create(
89
104
condition ,
90
105
variablesSet ,
91
106
requiredColumns ,
92
- joinType );
107
+ joinType ,
108
+ originRowCount );
93
109
}
94
110
111
+
95
112
@ Override public @ Nullable Pair <RelTraitSet , List <RelTraitSet >> passThroughTraits (
96
113
final RelTraitSet required ) {
97
114
return EnumerableTraitsUtils .passThroughTraitsForJoin (
@@ -115,8 +132,8 @@ public static EnumerableBatchNestedLoopJoin create(
115
132
@ Override public EnumerableBatchNestedLoopJoin copy (RelTraitSet traitSet ,
116
133
RexNode condition , RelNode left , RelNode right , JoinRelType joinType ,
117
134
boolean semiJoinDone ) {
118
- return new EnumerableBatchNestedLoopJoin (getCluster (), traitSet ,
119
- left , right , condition , variablesSet , requiredColumns , joinType );
135
+ return new EnumerableBatchNestedLoopJoin (getCluster (), traitSet , left , right , condition ,
136
+ variablesSet , requiredColumns , joinType , originRowCount );
120
137
}
121
138
122
139
@ Override public @ Nullable RelOptCost computeSelfCost (
@@ -149,6 +166,10 @@ public static EnumerableBatchNestedLoopJoin create(
149
166
return pw .item ("batchSize" , variablesSet .size ());
150
167
}
151
168
169
+ public @ Nullable Double getOriginRowCount () {
170
+ return originRowCount ;
171
+ }
172
+
152
173
@ Override public Result implement (EnumerableRelImplementor implementor , Prefer pref ) {
153
174
final BlockBuilder builder = new BlockBuilder ();
154
175
final Result leftResult =
0 commit comments