mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
Add base macros for sha128 definition
This commit is contained in:
1 parent
4dc3b68e97
commit
56ca07d7d1
2 files changed
+16
-2
No files matched your search
@@ -206,7 +206,17 @@ typedef std::unordered_map<const FunctionSignature*, const NativeFunction*, KeyH
|
||||
#define HASH64_SEED_SAFE_NULL_NEVER(NAME, ALIASES, TYPE) \
|
||||
NativeFunction(#NAME, std::vector<std::string> ALIASES, \
|
||||
DataTypeVector{TYPE(), int64()}, int64(), kResultNullNever, \
|
||||
ARROW_STRINGIFY(NAME##WithSeed_##TYPE))
|
||||
ARROW_STRINGIFY(NAME##WithSeed_##TYPE)
|
||||
|
||||
// HashSHA128 functions that :
|
||||
// - NULL handling is of type NULL_NEVER
|
||||
//
|
||||
// The function name includes the base name & input type name. gdv_fn_sha128_from_float64
|
||||
#define HASH_SHA128_SAFE_NULL_NEVER(NAME, ALIASES, TYPE) \
|
||||
NativeFunction(#NAME, std::vector<std::string> ALIASES, \
|
||||
DataTypeVector{TYPE()}, utf8(), kResultNullNever, \
|
||||
ARROW_STRINGIFY(gdv_fn_sha128_from_##TYPE), \
|
||||
NativeFunction::kNeedsContext)
|
||||
|
||||
// HashSHA256 functions that :
|
||||
// - NULL handling is of type NULL_NEVER
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
@@ -33,6 +32,9 @@ namespace gandiva {
|
||||
#define HASH64_SEED_SAFE_NULL_NEVER_FN(name, ALIASES) \
|
||||
NUMERIC_BOOL_DATE_VAR_LEN_TYPES(HASH64_SEED_SAFE_NULL_NEVER, name, ALIASES)
|
||||
|
||||
#define HASH_SHA128_SAFE_NULL_NEVER_FN(name, ALIASES) \
|
||||
NUMERIC_BOOL_DATE_VAR_LEN_TYPES(HASH_SHA128_SAFE_NULL_NEVER, name, ALIASES)
|
||||
|
||||
#define HASH_SHA256_SAFE_NULL_NEVER_FN(name, ALIASES) \
|
||||
NUMERIC_BOOL_DATE_VAR_LEN_TYPES(HASH_SHA256_SAFE_NULL_NEVER, name, ALIASES)
|
||||
|
||||
@@ -51,6 +53,8 @@ std::vector<NativeFunction> GetHashFunctionRegistry() {
|
||||
HASH64_SEED_SAFE_NULL_NEVER_FN(hash64, {}),
|
||||
HASH64_SEED_SAFE_NULL_NEVER_FN(hash64AsDouble, {}),
|
||||
|
||||
HASH_SHA128_SAFE_NULL_NEVER_FN(hashSHA128, {}),
|
||||
|
||||
HASH_SHA256_SAFE_NULL_NEVER_FN(hashSHA256, {})};
|
||||
|
||||
return hash_fn_registry_;
|
||||
|
||||
Reference in new issue
Block a user