merge to 87fd4ebd9977afb1e1193429dd75c7c82caab204 (#202)

1. ix bugs in query layer.
2. remove some redundant code in BE
3. support specify multi helper node when starting FE
4. add proc 'cluster_load_statistic' to show load balance situation of Palo
This commit is contained in:
morningman
2018-06-08 08:42:23 +08:00
committed by GitHub
parent c4be57150b
commit 9f7b1ea6d4
32 changed files with 855 additions and 640 deletions

View File

@ -34,26 +34,31 @@ namespace palo {
using palo_udf::BigIntVal;
using palo_udf::StringVal;
const int HllHashFunctions::HLL_INIT_EXPLICT_SET_SIZE = 10;
const int HllHashFunctions::HLL_EMPTY_SET_SIZE = 1;
void HllHashFunctions::init() {
}
StringVal HllHashFunctions::create_string_result(palo_udf::FunctionContext* ctx,
const StringVal& val, const bool is_null) {
std::string result;
StringVal result;
if (is_null) {
// HLL_DATA_EMPTY
result = "0";
char buf[HLL_EMPTY_SET_SIZE];
buf[0] = HLL_DATA_EMPTY;
result = AnyValUtil::from_buffer_temp(ctx, buf, sizeof(buf));
} else {
// HLL_DATA_EXPLHLL_DATA_EXPLICIT
uint64_t hash = HashUtil::murmur_hash64A(val.ptr, val.len, HashUtil::MURMUR_SEED);
char buf[10];
char buf[HLL_INIT_EXPLICT_SET_SIZE];
buf[0] = HLL_DATA_EXPLICIT;
buf[1] = 1;
*((uint64_t*)(buf + 2)) = hash;
result = std::string(buf, 10);
}
return AnyValUtil::from_buffer_temp(ctx, result.c_str(), result.length());
result = AnyValUtil::from_buffer_temp(ctx, buf, sizeof(buf));
}
return result;
}
StringVal HllHashFunctions::hll_hash(palo_udf::FunctionContext* ctx,