ScanComparisons implements PlanHashable { @Nullable public static ScanComparisons from(@Nonnull Comparisons.Comparison comparison) { switch (getComparisonType(comparison)) { case EQUALITY: return new ScanComparisons(Collections.singletonList(comparison), Collections.emptySet()); case INEQUALITY: return new ScanComparisons(Collections.emptyList(), Collections.singleton(comparison)); default: return null; } } ScanComparisons(@Nonnull List<Comparisons.Comparison> equalityComparisons,
                           @Nonnull Set<Comparisons.Comparison> inequalityComparisons); @Nonnull List<Comparisons.Comparison> getEqualityComparisons(); @Nonnull Set<Comparisons.Comparison> getInequalityComparisons(); int getEqualitySize(); int size(); int totalSize(); boolean isEmpty(); boolean isEquality(); @Nonnull static ComparisonType getComparisonType(@Nonnull Comparisons.Comparison comparison); @Nullable static ScanComparisons from(@Nonnull Comparisons.Comparison comparison); @Nullable ScanComparisons merge(@Nonnull ScanComparisons other); @Nullable ScanComparisons append(@Nonnull ScanComparisons other); @Nonnull TupleRange toTupleRange(); @Nonnull TupleRange toTupleRange(@Nullable FDBRecordStoreBase<?> store, @Nullable EvaluationContext context); @Nullable TupleRange toTupleRangeWithoutContext(); static Object toTupleItem(@Nullable Object item); @Override boolean equals(Object o); @Override int hashCode(); @Override int planHash(); @Override String toString(); static final ScanComparisons EMPTY; }
@Test public void multiColumn() throws Exception { ScanComparisons.Builder comparisons = new ScanComparisons.Builder(); comparisons.addEqualityComparison(new Comparisons.NullComparison(Comparisons.Type.IS_NULL)); comparisons.addInequalityComparison(new Comparisons.MultiColumnComparison(new Comparisons.SimpleComparison(Comparisons.Type.LESS_THAN, Tuple.from("xxx", "yyy")))); checkRange("([null, null],[null, xxx, yyy])", comparisons, context()); }