Class SortedRangeSet
java.lang.Object
io.trino.spi.predicate.SortedRangeSet
- All Implemented Interfaces:
ValueSet
A set containing zero or more Ranges of the same type over a continuous space of possible values.
Ranges are coalesced into the most compact representation of non-overlapping Ranges. This structure
allows iteration across these compacted Ranges in increasing order, as well as other common
set-related operation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static enum
-
Method Summary
Modifier and TypeMethodDescriptionstatic SortedRangeSet.Builder
boolean
boolean
containsValue
(Object value) static SortedRangeSet
Provided Ranges are unioned together to form the SortedRangeSetboolean
static SortedRangeSet
fromJson
(Type type, boolean[] inclusive, Block sortedRanges, SortedRangeSet.DiscreteSetMarker discreteSetMarker) Deprecated.boolean[]
int
long
getSpan()
getType()
int
hashCode()
boolean
isAll()
boolean
boolean
isNone()
boolean
boolean
toString()
toString
(ConnectorSession session) toString
(ConnectorSession session, int limit) tryExpandRanges
(int valuesLimit) Try to expandvalueSet
into a discrete set of (at mostlimit
) objects.union
(Collection<ValueSet> valueSets) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.trino.spi.predicate.ValueSet
getDiscreteValues, subtract
-
Method Details
-
fromJson
@Deprecated public static SortedRangeSet fromJson(Type type, boolean[] inclusive, Block sortedRanges, SortedRangeSet.DiscreteSetMarker discreteSetMarker) Deprecated. -
copyOf
Provided Ranges are unioned together to form the SortedRangeSet -
getType
-
getInclusive
public boolean[] getInclusive() -
getSortedRanges
-
getOrderedRanges
-
getRangeCount
public int getRangeCount() -
isNone
-
isAll
-
isSingleValue
public boolean isSingleValue()- Specified by:
isSingleValue
in interfaceValueSet
-
getSingleValue
- Specified by:
getSingleValue
in interfaceValueSet
-
getDiscreteSetMarker
-
isDiscreteSet
public boolean isDiscreteSet()- Specified by:
isDiscreteSet
in interfaceValueSet
-
getDiscreteSet
- Specified by:
getDiscreteSet
in interfaceValueSet
-
containsValue
- Specified by:
containsValue
in interfaceValueSet
-
getSpan
-
getRanges
-
getValuesProcessor
- Specified by:
getValuesProcessor
in interfaceValueSet
-
intersect
-
overlaps
-
union
-
union
-
contains
-
complement
- Specified by:
complement
in interfaceValueSet
-
hashCode
-
equals
-
toString
-
toString
-
toString
-
getRetainedSizeInBytes
public long getRetainedSizeInBytes()- Specified by:
getRetainedSizeInBytes
in interfaceValueSet
-
tryExpandRanges
Description copied from interface:ValueSet
Try to expandvalueSet
into a discrete set of (at mostlimit
) objects. For example: [1, 5] can be expanded into {1, 2, 3, 4, 5}. If the data type is not supported or the expansion results in too many values,Optional.empty()
is returned.- Specified by:
tryExpandRanges
in interfaceValueSet
-
builder
-