Class EquatableValueSet
- java.lang.Object
-
- com.amazonaws.athena.connector.lambda.domain.predicate.EquatableValueSet
-
- All Implemented Interfaces:
ValueSet
,AutoCloseable
public class EquatableValueSet extends Object implements ValueSet
A set containing values that are uniquely identifiable. Assumes an infinite number of possible values. The values may be collectively included (aka whitelist) or collectively excluded (aka !whitelist).- See Also:
ValueSet
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EquatableValueSet.Builder
-
Field Summary
Fields Modifier and Type Field Description boolean
nullAllowed
-
Constructor Summary
Constructors Constructor Description EquatableValueSet(Block valueBlock, boolean whiteList, boolean nullAllowed)
Constructs a new EquatableValueSet.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
EquatableValueSet
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 is contained in this ValueSet.boolean
equals(Object obj)
protected org.apache.arrow.vector.types.pojo.Schema
getSchema()
Object
getSingleValue()
Attempts to return the single value contained in this ValueSet.org.apache.arrow.vector.types.pojo.ArrowType
getType()
The Arrow Type of the field this constraint applies to.Object
getValue(int pos)
Retrieves the value at a specific position in this ValueSet.Block
getValueBlock()
Provides access to all the values in this ValueSet.Block
getValues()
Provides access to all the values in this ValueSet.int
hashCode()
EquatableValueSet
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.boolean
isWhiteList()
Conveys if this ValueSet if a white list.static EquatableValueSet.Builder
newBuilder(BlockAllocator allocator, org.apache.arrow.vector.types.pojo.ArrowType type, boolean isWhiteList, boolean nullAllowed)
Used to construct new Builder for EquatableValueSet.String
toString()
EquatableValueSet
union(BlockAllocator allocator, ValueSet other)
-
-
-
Constructor Detail
-
EquatableValueSet
public EquatableValueSet(Block valueBlock, boolean whiteList, boolean nullAllowed)
Constructs a new EquatableValueSet.- Parameters:
valueBlock
- The values that are in this ValueSet expressed as a Block of Apache Arrow records.whiteList
- True if this ValueSet is a white list (only these values), False if these are excluded values.nullAllowed
- True if null values should be considered part of this ValueSet, False otherwise.
-
-
Method Detail
-
newBuilder
public static EquatableValueSet.Builder newBuilder(BlockAllocator allocator, org.apache.arrow.vector.types.pojo.ArrowType type, boolean isWhiteList, boolean nullAllowed)
Used to construct new Builder for EquatableValueSet.- Parameters:
allocator
- The BlockAllocator to use when allocating Apache Arrow resources.type
- The type of the field that this EquatableValueSet will apply to.isWhiteList
- True if the EquatableValueSet will be a whitelist.nullAllowed
- True if the EquatableValueSet should include NULL.- Returns:
- A new Builder that can be used to add values and create a new EquatableValueSet.
-
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
-
getSchema
protected org.apache.arrow.vector.types.pojo.Schema getSchema()
-
getValueBlock
public Block getValueBlock()
Provides access to all the values in this ValueSet.- Returns:
- The Block of Apache Arrow records in this ValueSet.
-
getType
public org.apache.arrow.vector.types.pojo.ArrowType getType()
The Arrow Type of the field this constraint applies to.
-
isWhiteList
public boolean isWhiteList()
Conveys if this ValueSet if a white list.- Returns:
- True if the values in this ValueSet are part of a whitelist (e.g. list of values to include) vs a list of * values to exclude.
-
getValues
public Block getValues()
Provides access to all the values in this ValueSet.- Returns:
- The Block of Apache Arrow records in this ValueSet.
-
getValue
public Object getValue(int pos)
Retrieves the value at a specific position in this ValueSet.- Parameters:
pos
- The position to retrieve, should be < size of ValueSet- Returns:
- The value at that position.
-
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 is contained in this ValueSet.- Specified by:
containsValue
in interfaceValueSet
- Parameters:
value
- The value to test.- Returns:
- True if the value is contained in the ValueSet, False otherwise.
-
intersect
public EquatableValueSet intersect(BlockAllocator allocator, ValueSet other)
-
union
public EquatableValueSet union(BlockAllocator allocator, ValueSet other)
-
complement
public EquatableValueSet complement(BlockAllocator allocator)
- Specified by:
complement
in interfaceValueSet
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-