public class HashPrelUtil extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
HashPrelUtil.HashExpressionCreatorHelper<T>
Interface for creating different forms of hash expression types.
|
static class |
HashPrelUtil.RexNodeBasedHashExpressionCreatorHelper |
Modifier and Type | Field and Description |
---|---|
static int |
DIST_SEED |
static String |
HASH_EXPR_NAME |
static HashPrelUtil.HashExpressionCreatorHelper<LogicalExpression> |
HASH_HELPER_LOGICAL_EXPRESSION
Implementation of
HashPrelUtil.HashExpressionCreatorHelper for LogicalExpression type. |
Constructor and Description |
---|
HashPrelUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
createHash64Expression(List<T> inputExprs,
T seed,
HashPrelUtil.HashExpressionCreatorHelper<T> helper,
boolean hashAsDouble)
Create hash expression based on the given input fields.
|
static <T> T |
createHashBasedPartitionExpression(List<T> distFields,
T seed,
HashPrelUtil.HashExpressionCreatorHelper<T> helper)
Create hash based partition expression based on the given distribution fields.
|
static <T> T |
createHashExpression(List<T> inputExprs,
T seed,
HashPrelUtil.HashExpressionCreatorHelper<T> helper,
boolean hashAsDouble)
Create hash expression based on the given input fields.
|
static LogicalExpression |
getHash64Expression(LogicalExpression field,
LogicalExpression seed,
boolean hashAsDouble)
Creates hash expression for input field and seed.
|
static LogicalExpression |
getHashExpression(List<DrillDistributionTrait.DistributionField> fields,
org.apache.calcite.rel.type.RelDataType rowType)
Create a distribution hash expression.
|
static LogicalExpression |
getHashExpression(LogicalExpression field,
LogicalExpression seed,
boolean hashAsDouble)
Creates hash expression for input field and seed.
|
public static final String HASH_EXPR_NAME
public static final int DIST_SEED
public static HashPrelUtil.HashExpressionCreatorHelper<LogicalExpression> HASH_HELPER_LOGICAL_EXPRESSION
HashPrelUtil.HashExpressionCreatorHelper
for LogicalExpression
type.public static <T> T createHashBasedPartitionExpression(List<T> distFields, T seed, HashPrelUtil.HashExpressionCreatorHelper<T> helper)
T
- Input and output expression type.
Currently it could be either RexNode
or LogicalExpression
distFields
- Field list based on which the distribution partition expression is constructed.helper
- Implementation of HashPrelUtil.HashExpressionCreatorHelper
which is used to create function expressions.public static <T> T createHashExpression(List<T> inputExprs, T seed, HashPrelUtil.HashExpressionCreatorHelper<T> helper, boolean hashAsDouble)
T
- Input and output expression type.
Currently it could be either RexNode
or LogicalExpression
inputExprs
- Expression list based on which the hash expression is constructed.helper
- Implementation of HashPrelUtil.HashExpressionCreatorHelper
which is used to create function expressions.hashAsDouble
- Whether to use the hash as double function or regular hash64 function.public static <T> T createHash64Expression(List<T> inputExprs, T seed, HashPrelUtil.HashExpressionCreatorHelper<T> helper, boolean hashAsDouble)
T
- Input and output expression type.
Currently it could be either RexNode
or LogicalExpression
inputExprs
- Expression list based on which the hash expression is constructed.helper
- Implementation of HashPrelUtil.HashExpressionCreatorHelper
which is used to create function expressions.hashAsDouble
- Whether to use the hash as double function or regular hash64 function.public static LogicalExpression getHash64Expression(LogicalExpression field, LogicalExpression seed, boolean hashAsDouble)
field
- field expressionseed
- seed expressionhashAsDouble
- whether to use the hash as double function or regular hash64 functionpublic static LogicalExpression getHashExpression(LogicalExpression field, LogicalExpression seed, boolean hashAsDouble)
field
- field expressionseed
- seed expressionhashAsDouble
- whether to use the hash as double function or regular hash64 functionpublic static LogicalExpression getHashExpression(List<DrillDistributionTrait.DistributionField> fields, org.apache.calcite.rel.type.RelDataType rowType)
fields
- Distribution fieldsrowType
- Row typeCopyright © 2021 The Apache Software Foundation. All rights reserved.