public final class RangePartitioningFunction extends Object implements PartitioningFunction
PartitioningFunction.Evaluator
Constructor and Description |
---|
RangePartitioningFunction(List<RecordToken> values)
Range partitions based on multiple keys.
|
RangePartitioningFunction(String key,
List<? extends ScalarToken> values)
Range partitions based on a single key
|
Modifier and Type | Method and Description |
---|---|
List<RecordToken> |
getBoundaries()
Returns the boundaries to partition on
|
RecordTokenType |
getBoundaryType()
Returns the boundary type determined by the widest type of all boundaries
|
PartitioningFunction.Evaluator |
getEvaluator(PartitioningFunctionContext ctx)
Create an Evaluator bound to the specified context.
|
boolean |
isEquivalentPartitioning(PartitioningFunction other)
Returns true iff, given a single row of input, this function is guaranteed to produce the same
partitioning as the other function.
|
boolean |
isFunctionOfInput()
Returns true iff, given two identical rows of input, this function will
return the same value.
|
RangePartitioningFunction |
remapFieldReferences(Map<String,String> oldToNewMapping)
Creates a new function, equivalent to the given function, but with all field references
renamed according to the given mapping.
|
void |
validateForType(RecordTokenType type)
Performs validation of the specified input type
|
public RangePartitioningFunction(String key, List<? extends ScalarToken> values)
key
- the keyvalues
- the boundary values for the keypublic RangePartitioningFunction(List<RecordToken> values)
values
- the values to partition onpublic List<RecordToken> getBoundaries()
public RecordTokenType getBoundaryType()
public void validateForType(RecordTokenType type)
PartitioningFunction
validateForType
in interface PartitioningFunction
type
- the input typepublic PartitioningFunction.Evaluator getEvaluator(PartitioningFunctionContext ctx)
PartitioningFunction
getEvaluator
in interface PartitioningFunction
ctx
- the partitioning contextpublic boolean isEquivalentPartitioning(PartitioningFunction other)
PartitioningFunction
PartitioningFunction.isFunctionOfInput()
, this function must
return false if PartitioningFunction.isFunctionOfInput()
returns false.isEquivalentPartitioning
in interface PartitioningFunction
other
- the other functionpublic boolean isFunctionOfInput()
PartitioningFunction
isFunctionOfInput
in interface PartitioningFunction
public RangePartitioningFunction remapFieldReferences(Map<String,String> oldToNewMapping)
PartitioningFunction
remapFieldReferences
in interface PartitioningFunction
oldToNewMapping
- a mapping from old names to new names. If a name is not present in the
given mapping, it will remain as-is.Copyright © 2019 Actian Corporation. All rights reserved.