yangzhg commented on a change in pull request #6625:
URL: https://github.com/apache/incubator-doris/pull/6625#discussion_r708967291
##########
File path: be/src/olap/hll.cpp
##########
@@ -363,53 +427,53 @@ int64_t HyperLogLog::estimate_cardinality() const {
// there are relatively large fluctuations, we fixed the problem refer
to redis.
double bias = 5.9119 * 1.0e-18 * (estimate * estimate * estimate *
estimate) -
1.4253 * 1.0e-12 * (estimate * estimate * estimate) +
- 1.2940 * 1.0e-7 * (estimate * estimate) - 5.2921 *
1.0e-3 * estimate +
- 83.3216;
+ 1.2940 * 1.0e-7 * (estimate * estimate) -
+ 5.2921 * 1.0e-3 * estimate + 83.3216;
estimate -= estimate * (bias / 100);
}
return (int64_t)(estimate + 0.5);
}
void HllSetResolver::parse() {
// skip LengthValueType
- char* pdata = _buf_ref;
+ char* pdata = _buf_ref;
_set_type = (HllDataType)pdata[0];
char* sparse_data = NULL;
switch (_set_type) {
- case HLL_DATA_EXPLICIT:
- // first byte : type
- // second~five byte : hash values's number
- // five byte later : hash value
- _explicit_num =
(ExplicitLengthValueType)(pdata[sizeof(SetTypeValueType)]);
- _explicit_value =
- (uint64_t*)(pdata + sizeof(SetTypeValueType) +
sizeof(ExplicitLengthValueType));
- break;
- case HLL_DATA_SPARSE:
- // first byte : type
- // second ~(2^HLL_COLUMN_PRECISION)/8 byte : bitmap mark which is not
zero
- // 2^HLL_COLUMN_PRECISION)/8 + 1以后value
- _sparse_count = (SparseLengthValueType*)(pdata +
sizeof(SetTypeValueType));
- sparse_data = pdata + sizeof(SetTypeValueType) +
sizeof(SparseLengthValueType);
- for (int i = 0; i < *_sparse_count; i++) {
- SparseIndexType* index = (SparseIndexType*)sparse_data;
- sparse_data += sizeof(SparseIndexType);
- SparseValueType* value = (SparseValueType*)sparse_data;
- _sparse_map[*index] = *value;
- sparse_data += sizeof(SetTypeValueType);
- }
- break;
- case HLL_DATA_FULL:
- // first byte : type
- // second byte later : hll register value
- _full_value_position = pdata + sizeof(SetTypeValueType);
- break;
- default:
- // HLL_DATA_EMPTY
- break;
+ case HLL_DATA_EXPLICIT:
Review comment:
we don't indent with case statement
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]