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 classEquatableValueSet.Builder
-
Field Summary
Fields Modifier and Type Field Description booleannullAllowed
-
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 voidclose()EquatableValueSetcomplement(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 is contained in this ValueSet.booleanequals(Object obj)protected org.apache.arrow.vector.types.pojo.SchemagetSchema()ObjectgetSingleValue()Attempts to return the single value contained in this ValueSet.org.apache.arrow.vector.types.pojo.ArrowTypegetType()The Arrow Type of the field this constraint applies to.ObjectgetValue(int pos)Retrieves the value at a specific position in this ValueSet.BlockgetValueBlock()Provides access to all the values in this ValueSet.BlockgetValues()Provides access to all the values in this ValueSet.inthashCode()EquatableValueSetintersect(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.booleanisWhiteList()Conveys if this ValueSet if a white list.static EquatableValueSet.BuildernewBuilder(BlockAllocator allocator, org.apache.arrow.vector.types.pojo.ArrowType type, boolean isWhiteList, boolean nullAllowed)Used to construct new Builder for EquatableValueSet.StringtoString()EquatableValueSetunion(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:
isNullAllowedin 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:
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 is contained in this ValueSet.- Specified by:
containsValuein 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:
complementin interfaceValueSet
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-