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 class
SortedRangeSet.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SortedRangeSet
all(BlockAllocator allocator, org.apache.arrow.vector.types.pojo.ArrowType type)
void
close()
SortedRangeSet
complement(BlockAllocator allocator)
boolean
containsValue(Marker marker)
Used to test if the supplied value (in the form of a Marker) is contained in this ValueSet.boolean
containsValue(Object value)
Used to test if the supplied value (in the form of a Marker) is contained in this ValueSet.static SortedRangeSet
copyOf(org.apache.arrow.vector.types.pojo.ArrowType type, List<Range> ranges, boolean nullAllowed)
boolean
equals(Object obj)
List<Range>
getOrderedRanges()
int
getRangeCount()
Ranges
getRanges()
Provides access to the Ranges that comprise this ValueSet.Object
getSingleValue()
Attempts to return the single value contained in this ValueSet.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).org.apache.arrow.vector.types.pojo.ArrowType
getType()
The Arrow Type of the field this constraint applies to.int
hashCode()
SortedRangeSet
intersect(BlockAllocator allocator, ValueSet other)
boolean
isAll()
Conveys if any value can satisfy this ValueSet.boolean
isNone()
Conveys if no value can satisfy this ValueSet.boolean
isNullAllowed()
Conveys if nulls should be allowed.boolean
isSingleValue()
Conveys if this ValueSet contains a single value.static SortedRangeSet.Builder
newBuilder(org.apache.arrow.vector.types.pojo.ArrowType type, boolean nullAllowed)
static SortedRangeSet
none(org.apache.arrow.vector.types.pojo.ArrowType type)
static SortedRangeSet
notNull(BlockAllocator allocator, org.apache.arrow.vector.types.pojo.ArrowType type)
static SortedRangeSet
of(boolean nullAllowed, Range first, Range... rest)
Provided Ranges are unioned together to form the SortedRangeSetstatic SortedRangeSet
of(boolean nullAllowed, Range first, Collection<Range> rest)
Provided Ranges are unioned together to form the SortedRangeSetstatic SortedRangeSet
of(Range first, Range... rest)
Provided Ranges are unioned together to form the SortedRangeSetstatic SortedRangeSet
onlyNull(org.apache.arrow.vector.types.pojo.ArrowType type)
String
toString()
SortedRangeSet
union(BlockAllocator allocator, ValueSet other)
SortedRangeSet
union(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:
isNullAllowed
in 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:
isSingleValue
in 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:
getSingleValue
in 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:
containsValue
in 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:
containsValue
in 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:
complement
in 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:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-