- All Known Implementing Classes:
HashPartitioningFunction,HBasePartitioningFunction,RangePartitioningFunction
public interface PartitioningFunction
Represents a pluggable partitioning function; for use by operators that require custom partitioning
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceComputes partition assignments for each row if input -
Method Summary
Modifier and TypeMethodDescriptionCreate an Evaluator bound to the specified context.booleanReturns true iff, given a single row of input, this function is guaranteed to produce the same partitioning as the other function.booleanReturns true iff, given two identical rows of input, this function will return the same value.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.voidPerforms validation of the specified input type
-
Method Details
-
getEvaluator
Create an Evaluator bound to the specified context.- Parameters:
ctx- the partitioning context- Returns:
- an Evaluator bound to the specified context.
-
validateForType
Performs validation of the specified input type- Parameters:
type- the input type
-
isFunctionOfInput
boolean isFunctionOfInput()Returns true iff, given two identical rows of input, this function will return the same value. A return of true thus implies :- the function is deterministic
- the function is stateless (not sensitive to previous values read or to input ordering)
- Returns:
- whether this function is a stateless, deterministic function of input
-
isEquivalentPartitioning
Returns true iff, given a single row of input, this function is guaranteed to produce the same partitioning as the other function. A return of true thus implies the following:- both functions are deterministic
- both function are stateless (not sensitive to previous values read or to input ordering)
In addition, in order to be consistent withisFunctionOfInput(), this function must return false ifisFunctionOfInput()returns false.- Parameters:
other- the other function- Returns:
- whether this function produces the same results as the other function.
-
remapFieldReferences
Creates a new function, equivalent to the given function, but with all field references renamed according to the given mapping.- Parameters:
oldToNewMapping- a mapping from old names to new names. If a name is not present in the given mapping, it will remain as-is.- Returns:
- a new function with all field reference renamed appropriately
-