Skip to content

Commit

Permalink
fix format exception.
Browse files Browse the repository at this point in the history
Signed-off-by: chenminghua8 <cmptmn@126.com>
  • Loading branch information
chenminghua8 committed Oct 24, 2024
1 parent cf082a9 commit 2540ae9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion be/src/exprs/agg/ds_agg.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ struct DSSketchState<LT, QUANTILE> {
*ranks_prt = other_state.ranks.get()[i];
ranks_prt++;
}
ds_sketch_wrapper =
ds_sketch_wrapper =
std::make_unique<SketchWarapperType>(other_state.ds_sketch_wrapper->get_k(), &memory_usage);
}
ds_sketch_wrapper->merge(*other_state.ds_sketch_wrapper);
Expand Down
13 changes: 6 additions & 7 deletions be/src/types/ds_sketch.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class DataSketchesFrequent {
datasketches::frequent_items_sketch<T, uint64_t, std::hash<T>, std::equal_to<T>, alloc_type>;

explicit DataSketchesFrequent(uint8_t lg_max_map_size, uint8_t lg_start_map_size, int64_t* memory_usage)
: _memory_usage(memory_usage), _lg_max_map_size(lg_max_map_size) , _lg_start_map_size(lg_start_map_size){
: _memory_usage(memory_usage), _lg_max_map_size(lg_max_map_size), _lg_start_map_size(lg_start_map_size) {
_sketch = std::make_unique<frequent_sketch_type>(_lg_max_map_size, _lg_start_map_size, std::equal_to<T>(),
alloc_type(_memory_usage));
}
Expand Down Expand Up @@ -464,7 +464,7 @@ class DataSketchesTheta {

void merge(const DataSketchesTheta& other) {
if (_sketch_union == nullptr) {
_sketch_union =
_sketch_union =
std::make_unique<theta_union_type>(theta_union_type::builder(alloc_type(_memory_usage)).build());
}
_sketch_union->update(other._sketch->compact());
Expand All @@ -489,7 +489,7 @@ class DataSketchesTheta {

void serialize_if_needed() const {
if (UNLIKELY(_sketch == nullptr)) {
_sketch =
_sketch =
std::make_unique<theta_sketch_type>(theta_sketch_type::builder(alloc_type(_memory_usage)).build());
}
if (_is_changed) {
Expand All @@ -499,8 +499,8 @@ class DataSketchesTheta {
resultTheta_union.update(_sketch_union->get_result());
}
auto sketch_ser = resultTheta_union.get_result().serialize();
_sketch_data = std::make_unique<sketch_data_type>(sketch_data_type(
sketch_ser.begin(),sketch_ser.end(), sketch_ser.get_allocator()));
_sketch_data = std::make_unique<sketch_data_type>(
sketch_data_type(sketch_ser.begin(), sketch_ser.end(), sketch_ser.get_allocator()));
_is_changed = false;
}
}
Expand All @@ -510,8 +510,7 @@ class DataSketchesTheta {
return false;
}
DCHECK(_sketch == nullptr);
_sketch =
std::make_unique<theta_sketch_type>(theta_sketch_type::builder(alloc_type(_memory_usage)).build());
_sketch = std::make_unique<theta_sketch_type>(theta_sketch_type::builder(alloc_type(_memory_usage)).build());
try {
auto sketch_warp = theta_wrapped_type::wrap((uint8_t*)slice.data, slice.size);
if (_sketch_union == nullptr) {
Expand Down

0 comments on commit 2540ae9

Please sign in to comment.