18
18
import io .delta .kernel .data .ColumnVector ;
19
19
import io .delta .kernel .data .ColumnarBatch ;
20
20
import io .delta .kernel .data .Row ;
21
- import io .delta .kernel .internal .DeltaHistoryManager ;
22
- import io .delta .kernel .internal .actions .CommitInfo ;
23
21
import io .delta .kernel .internal .fs .Path ;
24
22
import io .delta .kernel .types .DataType ;
25
23
import io .delta .kernel .types .StringType ;
@@ -172,7 +170,10 @@ public static Set<String> toLowerCaseSet(Collection<String> set) {
172
170
}
173
171
174
172
public static Tuple2 <Long , Long > greatestLowerBound (
175
- long target , long lowerBoundInclusive , long upperBoundExclusive , Function <Long , Long > keyToValueMapper ) {
173
+ long target ,
174
+ long lowerBoundInclusive ,
175
+ long upperBoundExclusive ,
176
+ Function <Long , Long > keyToValueMapper ) {
176
177
long start = lowerBoundInclusive ;
177
178
long end = upperBoundExclusive ;
178
179
Tuple2 <Long , Long > result = null ;
@@ -192,12 +193,18 @@ public static Tuple2<Long, Long> greatestLowerBound(
192
193
}
193
194
194
195
public static Tuple2 <Long , Long > getNarrowSearchBoundsUsingExponentialSearch (
195
- long target , long lowerBoundInclusive , long upperBoundExclusive , Function <Long , Long > keyToValueMapper , boolean reversed ) {
196
+ long target ,
197
+ long lowerBoundInclusive ,
198
+ long upperBoundExclusive ,
199
+ Function <Long , Long > keyToValueMapper ,
200
+ boolean reversed ) {
196
201
final long iterationDirection = reversed ? -1 : 1 ;
197
202
long lowerBoundKey = lowerBoundInclusive ;
198
203
long upperBoundKey ;
199
204
long curKey = lowerBoundInclusive + 1 ;
200
- for (long i = 0 ; curKey < upperBoundExclusive ; curKey = Math .round (lowerBoundInclusive + iterationDirection *Math .pow (2 , i ++))) {
205
+ for (long i = 0 ;
206
+ curKey < upperBoundExclusive ;
207
+ curKey = Math .round (lowerBoundInclusive + iterationDirection * Math .pow (2 , i ++))) {
201
208
long curValue = keyToValueMapper .apply (curKey );
202
209
if (curValue > target ) {
203
210
break ;
@@ -206,6 +213,8 @@ public static Tuple2<Long, Long> getNarrowSearchBoundsUsingExponentialSearch(
206
213
}
207
214
}
208
215
upperBoundKey = Math .min (curKey , upperBoundExclusive );
209
- return reversed ? new Tuple2 <>(upperBoundKey , lowerBoundKey ) : new Tuple2 <>(lowerBoundKey , upperBoundKey );
216
+ return reversed
217
+ ? new Tuple2 <>(upperBoundKey , lowerBoundKey )
218
+ : new Tuple2 <>(lowerBoundKey , upperBoundKey );
210
219
}
211
220
}
0 commit comments