Add base macros for sha128 definition

This commit is contained in:
João Pedro authored and Anthony Louis committed 2021-04-09 19:34:23 -03:00
1 parent 4dc3b68e97
commit 56ca07d7d1
2 files changed
+16 -2

No files matched your search

+11 -1
View File
@@ -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
+5 -1
View File
@@ -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_;