add computeHashHook
This commit is contained in:
@ -708,6 +708,9 @@ Datum compute_hash(Oid type, Datum value, char locator)
|
||||
return DirectFunctionCall1(uuid_hash, value);
|
||||
|
||||
default:
|
||||
if (u_sess->hook_cxt.computeHashHook != NULL) {
|
||||
return ((computeHashFunc)(u_sess->hook_cxt.computeHashHook))(type, value, locator);
|
||||
}
|
||||
ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE),
|
||||
errmsg("Unhandled datatype for modulo or hash distribution\n")));
|
||||
}
|
||||
|
||||
@ -440,4 +440,6 @@ extern uint32 hash_multikey(MultiHashKey* mkeys);
|
||||
|
||||
#define GetBucketID(hashval, hashmapsize) (compute_modulo(abs((int)hashval), hashmapsize))
|
||||
|
||||
typedef Datum (*computeHashFunc)(Oid type, Datum value, char locator);
|
||||
|
||||
#endif /* HASH_H */
|
||||
|
||||
@ -2640,6 +2640,7 @@ typedef struct knl_u_hook_context {
|
||||
void *analyzerRoutineHook;
|
||||
void *transformStmtHook;
|
||||
void *execInitExprHook;
|
||||
void *computeHashHook;
|
||||
} knl_u_hook_context;
|
||||
|
||||
typedef struct knl_session_context {
|
||||
|
||||
Reference in New Issue
Block a user