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.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DIST_SEED |
static String |
HASH_EXPR_NAME |
static HashPrelUtil.HashExpressionCreatorHelper<LogicalExpression> |
HASH_HELPER_LOGICALEXPRESSION
Implementation of
HashPrelUtil.HashExpressionCreatorHelper for LogicalExpression type. |
| Constructor and Description |
|---|
HashPrelUtil() |
| Modifier and Type | Method and Description |
|---|---|
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 |
getHashExpression(List<DrillDistributionTrait.DistributionField> fields,
org.apache.calcite.rel.type.RelDataType rowType)
Create a distribution hash expression.
|
static LogicalExpression |
getHashExpression(List<LogicalExpression> fields,
boolean hashAsDouble)
Return a hash expression : hash32(field1, hash32(field2, hash32(field3, 0)));
|
public static final String HASH_EXPR_NAME
public static final int DIST_SEED
public static HashPrelUtil.HashExpressionCreatorHelper<LogicalExpression> HASH_HELPER_LOGICALEXPRESSION
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 LogicalExpressiondistFields - 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 LogicalExpressioninputExprs - 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 getHashExpression(List<LogicalExpression> fields, boolean hashAsDouble)
public static LogicalExpression getHashExpression(List<DrillDistributionTrait.DistributionField> fields, org.apache.calcite.rel.type.RelDataType rowType)
fields - Distribution fieldsrowType - Row typeCopyright © 2017 The Apache Software Foundation. All rights reserved.