@@ -139,7 +139,7 @@ public <T> Boolean isNull(Bound<T> term) {
139139 // if the column has no null values, the expression cannot match
140140 if (isNonNullPreserving (term )) {
141141 // number of non-nulls is the same as for the ref
142- Integer id = term .ref ().fieldId ();
142+ int id = term .ref ().fieldId ();
143143 if (!mayContainNull (id )) {
144144 return ROWS_CANNOT_MATCH ;
145145 }
@@ -154,7 +154,7 @@ public <T> Boolean notNull(Bound<T> term) {
154154 // if the column has no non-null values, the expression cannot match
155155
156156 // all terms are null preserving. see #isNullPreserving(Bound)
157- Integer id = term .ref ().fieldId ();
157+ int id = term .ref ().fieldId ();
158158 if (containsNullsOnly (id )) {
159159 return ROWS_CANNOT_MATCH ;
160160 }
@@ -166,7 +166,7 @@ public <T> Boolean notNull(Bound<T> term) {
166166 public <T > Boolean isNaN (Bound <T > term ) {
167167 // when there's no nanCounts information, but we already know the column only contains null,
168168 // it's guaranteed that there's no NaN value
169- Integer id = term .ref ().fieldId ();
169+ int id = term .ref ().fieldId ();
170170 if (containsNullsOnly (id )) {
171171 return ROWS_CANNOT_MATCH ;
172172 }
@@ -189,7 +189,7 @@ public <T> Boolean notNaN(Bound<T> term) {
189189 return ROWS_MIGHT_MATCH ;
190190 }
191191
192- Integer id = term .ref ().fieldId ();
192+ int id = term .ref ().fieldId ();
193193
194194 if (containsNaNsOnly (id )) {
195195 return ROWS_CANNOT_MATCH ;
@@ -201,7 +201,7 @@ public <T> Boolean notNaN(Bound<T> term) {
201201 @ Override
202202 public <T > Boolean lt (Bound <T > term , Literal <T > lit ) {
203203 // all terms are null preserving. see #isNullPreserving(Bound)
204- Integer id = term .ref ().fieldId ();
204+ int id = term .ref ().fieldId ();
205205 if (containsNullsOnly (id ) || containsNaNsOnly (id )) {
206206 return ROWS_CANNOT_MATCH ;
207207 }
@@ -228,7 +228,7 @@ public <T> Boolean lt(Bound<T> term, Literal<T> lit) {
228228 @ Override
229229 public <T > Boolean ltEq (Bound <T > term , Literal <T > lit ) {
230230 // all terms are null preserving. see #isNullPreserving(Bound)
231- Integer id = term .ref ().fieldId ();
231+ int id = term .ref ().fieldId ();
232232 if (containsNullsOnly (id ) || containsNaNsOnly (id )) {
233233 return ROWS_CANNOT_MATCH ;
234234 }
@@ -255,7 +255,7 @@ public <T> Boolean ltEq(Bound<T> term, Literal<T> lit) {
255255 @ Override
256256 public <T > Boolean gt (Bound <T > term , Literal <T > lit ) {
257257 // all terms are null preserving. see #isNullPreserving(Bound)
258- Integer id = term .ref ().fieldId ();
258+ int id = term .ref ().fieldId ();
259259 if (containsNullsOnly (id ) || containsNaNsOnly (id )) {
260260 return ROWS_CANNOT_MATCH ;
261261 }
@@ -276,7 +276,7 @@ public <T> Boolean gt(Bound<T> term, Literal<T> lit) {
276276 @ Override
277277 public <T > Boolean gtEq (Bound <T > term , Literal <T > lit ) {
278278 // all terms are null preserving. see #isNullPreserving(Bound)
279- Integer id = term .ref ().fieldId ();
279+ int id = term .ref ().fieldId ();
280280 if (containsNullsOnly (id ) || containsNaNsOnly (id )) {
281281 return ROWS_CANNOT_MATCH ;
282282 }
@@ -297,7 +297,7 @@ public <T> Boolean gtEq(Bound<T> term, Literal<T> lit) {
297297 @ Override
298298 public <T > Boolean eq (Bound <T > term , Literal <T > lit ) {
299299 // all terms are null preserving. see #isNullPreserving(Bound)
300- Integer id = term .ref ().fieldId ();
300+ int id = term .ref ().fieldId ();
301301 if (containsNullsOnly (id ) || containsNaNsOnly (id )) {
302302 return ROWS_CANNOT_MATCH ;
303303 }
@@ -333,7 +333,7 @@ public <T> Boolean notEq(Bound<T> term, Literal<T> lit) {
333333 @ Override
334334 public <T > Boolean in (Bound <T > term , Set <T > literalSet ) {
335335 // all terms are null preserving. see #isNullPreserving(Bound)
336- Integer id = term .ref ().fieldId ();
336+ int id = term .ref ().fieldId ();
337337 if (containsNullsOnly (id ) || containsNaNsOnly (id )) {
338338 return ROWS_CANNOT_MATCH ;
339339 }
@@ -392,7 +392,7 @@ public <T> Boolean startsWith(Bound<T> term, Literal<T> lit) {
392392 return ROWS_MIGHT_MATCH ;
393393 }
394394
395- Integer id = term .ref ().fieldId ();
395+ int id = term .ref ().fieldId ();
396396 if (containsNullsOnly (id )) {
397397 return ROWS_CANNOT_MATCH ;
398398 }
@@ -431,7 +431,7 @@ public <T> Boolean startsWith(Bound<T> term, Literal<T> lit) {
431431 @ Override
432432 public <T > Boolean notStartsWith (Bound <T > term , Literal <T > lit ) {
433433 // the only transforms that produce strings are truncate and identity, which work with this
434- Integer id = term .ref ().fieldId ();
434+ int id = term .ref ().fieldId ();
435435 if (mayContainNull (id )) {
436436 return ROWS_MIGHT_MATCH ;
437437 }
@@ -515,7 +515,7 @@ private <T> T upperBound(Bound<T> term) {
515515 }
516516
517517 private <T > T parseLowerBound (BoundReference <T > ref ) {
518- Integer id = ref .fieldId ();
518+ int id = ref .fieldId ();
519519 if (lowerBounds != null && lowerBounds .containsKey (id )) {
520520 return Conversions .fromByteBuffer (ref .ref ().type (), lowerBounds .get (id ));
521521 }
@@ -524,7 +524,7 @@ private <T> T parseLowerBound(BoundReference<T> ref) {
524524 }
525525
526526 private <T > T parseUpperBound (BoundReference <T > ref ) {
527- Integer id = ref .fieldId ();
527+ int id = ref .fieldId ();
528528 if (upperBounds != null && upperBounds .containsKey (id )) {
529529 return Conversions .fromByteBuffer (ref .ref ().type (), upperBounds .get (id ));
530530 }
@@ -553,7 +553,7 @@ private <S, T> T transformUpperBound(BoundTransform<S, T> boundTransform) {
553553 }
554554
555555 private <T > T extractLowerBound (BoundExtract <T > bound ) {
556- Integer id = bound .ref ().fieldId ();
556+ int id = bound .ref ().fieldId ();
557557 if (lowerBounds != null && lowerBounds .containsKey (id )) {
558558 VariantObject fieldLowerBounds = parseBounds (lowerBounds .get (id ));
559559 return VariantExpressionUtil .castTo (fieldLowerBounds .get (bound .path ()), bound .type ());
@@ -563,7 +563,7 @@ private <T> T extractLowerBound(BoundExtract<T> bound) {
563563 }
564564
565565 private <T > T extractUpperBound (BoundExtract <T > bound ) {
566- Integer id = bound .ref ().fieldId ();
566+ int id = bound .ref ().fieldId ();
567567 if (upperBounds != null && upperBounds .containsKey (id )) {
568568 VariantObject fieldUpperBounds = parseBounds (upperBounds .get (id ));
569569 return VariantExpressionUtil .castTo (fieldUpperBounds .get (bound .path ()), bound .type ());
@@ -572,22 +572,6 @@ private <T> T extractUpperBound(BoundExtract<T> bound) {
572572 return null ;
573573 }
574574
575- /** Returns true if the expression term produces a null value for a null input. */
576- // private boolean isNullPreserving(Bound<?> term) {
577- // if (term instanceof BoundReference) {
578- // return true;
579- // } else if (term instanceof BoundTransform<?, ?>) {
580- // // transforms must map null to null
581- // return true;
582- // } else if (term instanceof BoundExtract) {
583- // // a null variant contains no non-null values
584- // return true;
585- // }
586- //
587- // // unknown cases are not null preserving
588- // return false;
589- // }
590-
591575 /** Returns true if the expression term produces a non-null value for non-null input. */
592576 private boolean isNonNullPreserving (Bound <?> term ) {
593577 if (term instanceof BoundReference ) {
0 commit comments