mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
Fix problems for wrong types in windows
This commit is contained in:
1 parent
4bf483cecb
commit
899ccb6cad
4 files changed
+26
-44
No files matched your search
@@ -126,7 +126,7 @@ int32_t gdv_fn_populate_varlen_vector(int64_t context_ptr, int8_t* data_ptr,
|
||||
#define SHA128_HASH_FUNCTION(TYPE) \
|
||||
GANDIVA_EXPORT \
|
||||
const char *gdv_fn_sha128_##TYPE(int64_t context, gdv_##TYPE value, \
|
||||
bool validity, u_int32_t *out_length) { \
|
||||
bool validity, int32_t *out_length) { \
|
||||
if (!validity) { \
|
||||
*out_length = 0; \
|
||||
return ""; \
|
||||
@@ -146,7 +146,7 @@ int32_t gdv_fn_populate_varlen_vector(int64_t context_ptr, int8_t* data_ptr,
|
||||
gdv_##TYPE value, \
|
||||
int32_t value_length, \
|
||||
bool value_validity, \
|
||||
u_int32_t *out_length) { \
|
||||
int32_t *out_length) { \
|
||||
if (!value_validity) { \
|
||||
*out_length = 0; \
|
||||
return ""; \
|
||||
@@ -158,7 +158,7 @@ int32_t gdv_fn_populate_varlen_vector(int64_t context_ptr, int8_t* data_ptr,
|
||||
#define SHA256_HASH_FUNCTION(TYPE) \
|
||||
GANDIVA_EXPORT \
|
||||
const char *gdv_fn_sha256_##TYPE(int64_t context, gdv_##TYPE value, \
|
||||
bool validity, u_int32_t *out_length) { \
|
||||
bool validity, int32_t *out_length) { \
|
||||
if (!validity) { \
|
||||
*out_length = 0; \
|
||||
return ""; \
|
||||
@@ -177,7 +177,7 @@ int32_t gdv_fn_populate_varlen_vector(int64_t context_ptr, int8_t* data_ptr,
|
||||
gdv_##TYPE value, \
|
||||
int32_t value_length, \
|
||||
bool value_validity, \
|
||||
u_int32_t *out_length) { \
|
||||
int32_t *out_length) { \
|
||||
if (!value_validity) { \
|
||||
*out_length = 0; \
|
||||
return ""; \
|
||||
@@ -224,8 +224,8 @@ SHA_VAR_LEN_PARAMS(SHA128_HASH_FUNCTION_BUF)
|
||||
// Add functions for decimal128
|
||||
GANDIVA_EXPORT
|
||||
const char* gdv_fn_sha256_decimal128(int64_t context, int64_t x_high, uint64_t x_low,
|
||||
int32_t x_precision, int32_t x_scale,
|
||||
gdv_boolean x_isvalid, u_int32_t *out_length) {
|
||||
int32_t x_precision, int32_t x_scale,
|
||||
gdv_boolean x_isvalid, int32_t *out_length) {
|
||||
if (!x_isvalid) {
|
||||
*out_length = 0;
|
||||
return "";
|
||||
@@ -238,8 +238,8 @@ const char* gdv_fn_sha256_decimal128(int64_t context, int64_t x_high, uint64_t x
|
||||
|
||||
GANDIVA_EXPORT
|
||||
const char* gdv_fn_sha128_decimal128(int64_t context, int64_t x_high, uint64_t x_low,
|
||||
int32_t x_precision, int32_t x_scale,
|
||||
gdv_boolean x_isvalid, u_int32_t *out_length) {
|
||||
int32_t x_precision, int32_t x_scale,
|
||||
gdv_boolean x_isvalid, int32_t *out_length) {
|
||||
if (!x_isvalid) {
|
||||
*out_length = 0;
|
||||
return "";
|
||||
|
||||
@@ -67,31 +67,13 @@ bool in_expr_lookup_utf8(int64_t ptr, const char* data, int data_len, bool in_va
|
||||
int gdv_fn_time_with_zone(int* time_fields, const char* zone, int zone_len,
|
||||
int64_t* ret_time);
|
||||
|
||||
const char *gdv_fn_sha256_float64(int64_t context, double value, bool validity,
|
||||
unsigned int *out_length);
|
||||
|
||||
const char *gdv_fn_sha256_utf8(int64_t context,
|
||||
char *value,
|
||||
int32_t value_length,
|
||||
bool value_validity,
|
||||
uint32_t *out_length);
|
||||
|
||||
const char *gdv_fn_sha128_float64(int64_t context, double value, bool validity,
|
||||
unsigned int *out_length);
|
||||
|
||||
const char *gdv_fn_sha128_utf8(int64_t context,
|
||||
char *value,
|
||||
int32_t value_length,
|
||||
bool value_validity,
|
||||
uint32_t *out_length);
|
||||
|
||||
const char* gdv_fn_sha256_decimal128(int64_t context, int64_t x_high, uint64_t x_low,
|
||||
int32_t x_precision, int32_t x_scale,
|
||||
gdv_boolean x_isvalid, uint32_t *out_length);
|
||||
int32_t x_precision, int32_t x_scale,
|
||||
gdv_boolean x_isvalid, int32_t *out_length);
|
||||
|
||||
const char* gdv_fn_sha128_decimal128(int64_t context, int64_t x_high, uint64_t x_low,
|
||||
int32_t x_precision, int32_t x_scale,
|
||||
gdv_boolean x_isvalid, uint32_t *out_length);
|
||||
int32_t x_precision, int32_t x_scale,
|
||||
gdv_boolean x_isvalid, int32_t *out_length);
|
||||
|
||||
int32_t gdv_fn_dec_from_string(int64_t context, const char* in, int32_t in_length,
|
||||
int32_t* precision_from_str, int32_t* scale_from_str,
|
||||
|
||||
@@ -23,18 +23,18 @@
|
||||
|
||||
namespace gandiva {
|
||||
const char* HashUtils::HashUsingSha256(int64_t context,
|
||||
const void* message,
|
||||
size_t message_length,
|
||||
u_int32_t* out_length) {
|
||||
const void* message,
|
||||
size_t message_length,
|
||||
int32_t *out_length) {
|
||||
// The buffer size is the hash size + null character
|
||||
int sha256_result_length = 65;
|
||||
return HashUtils::GetHash(context, message, message_length, EVP_sha256(),
|
||||
sha256_result_length, out_length);
|
||||
}
|
||||
const char* HashUtils::HashUsingSha128(int64_t context,
|
||||
const void* message,
|
||||
size_t message_length,
|
||||
u_int32_t* out_length) {
|
||||
const void* message,
|
||||
size_t message_length,
|
||||
int32_t *out_length) {
|
||||
// The buffer size is the hash size + null character
|
||||
int sha128_result_length = 41;
|
||||
return HashUtils::GetHash(context, message, message_length, EVP_sha1(),
|
||||
@@ -46,7 +46,7 @@ namespace gandiva {
|
||||
size_t message_length,
|
||||
const EVP_MD *hash_type,
|
||||
int result_buf_size,
|
||||
u_int32_t* out_length) {
|
||||
int32_t *out_length) {
|
||||
EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
|
||||
|
||||
if (md_ctx == nullptr) {
|
||||
|
||||
@@ -27,14 +27,14 @@ namespace gandiva {
|
||||
class GANDIVA_EXPORT HashUtils {
|
||||
public:
|
||||
static const char *HashUsingSha256(int64_t context,
|
||||
const void *message,
|
||||
size_t message_length,
|
||||
u_int32_t *out_length);
|
||||
const void *message,
|
||||
size_t message_length,
|
||||
int32_t *out_length);
|
||||
|
||||
static const char *HashUsingSha128(int64_t context,
|
||||
const void *message,
|
||||
size_t message_length,
|
||||
u_int32_t *out_length);
|
||||
const void *message,
|
||||
size_t message_length,
|
||||
int32_t *out_length);
|
||||
|
||||
static uint64_t DoubleToLong(double value);
|
||||
private:
|
||||
@@ -45,7 +45,7 @@ class GANDIVA_EXPORT HashUtils {
|
||||
size_t message_length,
|
||||
const EVP_MD *hash_type,
|
||||
int result_buf_size,
|
||||
u_int32_t *out_length);
|
||||
int32_t *out_length);
|
||||
|
||||
static void ErrorMessage(int64_t context_ptr, char const *err_msg);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user