Class SortedRangeSet
- java.lang.Object
-
- com.amazonaws.athena.connector.lambda.domain.predicate.SortedRangeSet
-
- All Implemented Interfaces:
ValueSet,AutoCloseable
public class SortedRangeSet extends Object implements ValueSet
A set containing values that are represented as ranges that are sorted by their lower bound. For example: col between 10 and 30, or col between 40 and 60, or col between 90 and 1000.- See Also:
ValueSet
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSortedRangeSet.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SortedRangeSetall(BlockAllocator allocator, org.apache.arrow.vector.types.pojo.ArrowType type)voidclose()SortedRangeSetcomplement(BlockAllocator allocator)booleancontainsValue(Marker marker)Used to test if the supplied value (in the form of a Marker) is contained in this ValueSet.booleancontainsValue(Object value)Used to test if the supplied value (in the form of a Marker) is contained in this ValueSet.static SortedRangeSetcopyOf(org.apache.arrow.vector.types.pojo.ArrowType type, List<Range> ranges, boolean nullAllowed)booleanequals(Object obj)List<Range>getOrderedRanges()intgetRangeCount()RangesgetRanges()Provides access to the Ranges that comprise this ValueSet.ObjectgetSingleValue()Attempts to return the single value contained in this ValueSet.RangegetSpan()Gets a summary of the lowest lower bound and the highest upper bound that represents this ValueSet, keep in mind that this summary may include more than the actual SortedRangeSet (e.g. col between 10 and 40 or col between 50 and 80 would yield a span of between 10 and 80).org.apache.arrow.vector.types.pojo.ArrowTypegetType()The Arrow Type of the field this constraint applies to.inthashCode()SortedRangeSetintersect(BlockAllocator allocator, ValueSet other)booleanisAll()Conveys if any value can satisfy this ValueSet.booleanisNone()Conveys if no value can satisfy this ValueSet.booleanisNullAllowed()Conveys if nulls should be allowed.booleanisSingleValue()Conveys if this ValueSet contains a single value.static SortedRangeSet.BuildernewBuilder(org.apache.arrow.vector.types.pojo.ArrowType type, boolean nullAllowed)static SortedRangeSetnone(org.apache.arrow.vector.types.pojo.ArrowType type)static SortedRangeSetnotNull(BlockAllocator allocator, org.apache.arrow.vector.types.pojo.ArrowType type)static SortedRangeSetof(boolean nullAllowed, Range first, Range... rest)Provided Ranges are unioned together to form the SortedRangeSetstatic SortedRangeSetof(boolean nullAllowed, Range first, Collection<Range> rest)Provided Ranges are unioned together to form the SortedRangeSetstatic SortedRangeSetof(Range first, Range... rest)Provided Ranges are unioned together to form the SortedRangeSetstatic SortedRangeSetonlyNull(org.apache.arrow.vector.types.pojo.ArrowType type)StringtoString()SortedRangeSetunion(BlockAllocator allocator, ValueSet other)SortedRangeSetunion(BlockAllocator allocator, Collection<ValueSet> valueSets)
-
-
-
Method Detail
-
none
public static SortedRangeSet none(org.apache.arrow.vector.types.pojo.ArrowType type)
-
all
public static SortedRangeSet all(BlockAllocator allocator, org.apache.arrow.vector.types.pojo.ArrowType type)
-
onlyNull
public static SortedRangeSet onlyNull(org.apache.arrow.vector.types.pojo.ArrowType type)
-
notNull
public static SortedRangeSet notNull(BlockAllocator allocator, org.apache.arrow.vector.types.pojo.ArrowType type)
-
of
public static SortedRangeSet of(Range first, Range... rest)
Provided Ranges are unioned together to form the SortedRangeSet
-
of
public static SortedRangeSet of(boolean nullAllowed, Range first, Range... rest)
Provided Ranges are unioned together to form the SortedRangeSet
-
of
public static SortedRangeSet of(boolean nullAllowed, Range first, Collection<Range> rest)
Provided Ranges are unioned together to form the SortedRangeSet
-
copyOf
public static SortedRangeSet copyOf(org.apache.arrow.vector.types.pojo.ArrowType type, List<Range> ranges, boolean nullAllowed)
-
isNullAllowed
public boolean isNullAllowed()
Conveys if nulls should be allowed.- Specified by:
isNullAllowedin interfaceValueSet- Returns:
- True if NULLs satisfy this constraint, false otherwise.
- See Also:
ValueSet
-
getType
public org.apache.arrow.vector.types.pojo.ArrowType getType()
The Arrow Type of the field this constraint applies to.
-
getRangeCount
public int getRangeCount()
-
isNone
public boolean isNone()
Conveys if no value can satisfy this ValueSet.
-
isAll
public boolean isAll()
Conveys if any value can satisfy this ValueSet.
-
isSingleValue
public boolean isSingleValue()
Conveys if this ValueSet contains a single value.- Specified by:
isSingleValuein interfaceValueSet- Returns:
- True if this ValueSet contains only a single value.
-
getSingleValue
public Object getSingleValue()
Attempts to return the single value contained in this ValueSet.- Specified by:
getSingleValuein interfaceValueSet- Returns:
- The single value contained in this ValueSet.
- Throws:
IllegalStateException- if this ValueSet does not contain exactly 1 value.
-
containsValue
public boolean containsValue(Marker marker)
Used to test if the supplied value (in the form of a Marker) is contained in this ValueSet.- Specified by:
containsValuein interfaceValueSet- Parameters:
marker- The value to test in the form of a Marker.- Returns:
- True if the value is contained in the ValueSet, False otherwise.
-
containsValue
public boolean containsValue(Object value)
Used to test if the supplied value (in the form of a Marker) is contained in this ValueSet.- Specified by:
containsValuein interfaceValueSet- Parameters:
value- The value to test in the form of a Marker.- Returns:
- True if the value is contained in the ValueSet, False otherwise.
-
getSpan
public Range getSpan()
Gets a summary of the lowest lower bound and the highest upper bound that represents this ValueSet, keep in mind that this summary may include more than the actual SortedRangeSet (e.g. col between 10 and 40 or col between 50 and 80 would yield a span of between 10 and 80).- Returns:
- A Span which encompasses the lower bound and upper bound of the ValueSet.
-
getRanges
public Ranges getRanges()
Provides access to the Ranges that comprise this ValueSet.
-
intersect
public SortedRangeSet intersect(BlockAllocator allocator, ValueSet other)
-
union
public SortedRangeSet union(BlockAllocator allocator, ValueSet other)
-
union
public SortedRangeSet union(BlockAllocator allocator, Collection<ValueSet> valueSets)
-
complement
public SortedRangeSet complement(BlockAllocator allocator)
- Specified by:
complementin interfaceValueSet
-
newBuilder
public static SortedRangeSet.Builder newBuilder(org.apache.arrow.vector.types.pojo.ArrowType type, boolean nullAllowed)
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-