Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Nov 15, 2024
1 parent 61edf97 commit 7dd8c21
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class AggregateFunctionApproxTopK final
void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf,
Arena* arena) const override {
auto readStringBinaryInto = [](Arena& arena, BufferReadable& buf) {
size_t size = 0;
uint64_t size = 0;
read_var_uint(size, buf);

if (UNLIKELY(size > DEFAULT_MAX_STRING_SIZE)) {
Expand All @@ -104,7 +104,7 @@ class AggregateFunctionApproxTopK final
auto& set = this->data(place).value;
set.clear();

size_t size = 0;
uint64_t size = 0;
read_var_uint(size, buf);
if (UNLIKELY(size > TOP_K_MAX_SIZE)) {
throw Exception(ErrorCode::INTERNAL_ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct AggregateFunctionCollectSetData {
}

void read(BufferReadable& buf) {
size_t new_size = 0;
uint64_t new_size = 0;
read_var_uint(new_size, buf);
ElementNativeType x;
for (size_t i = 0; i < new_size; ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct AggregateFunctionDistinctSingleNumericData {
void deserialize(BufferReadable& buf, Arena*) {
DCHECK(!stable);
if constexpr (!stable) {
size_t new_size = 0;
uint64_t new_size = 0;
read_var_uint(new_size, buf);
T x;
for (size_t i = 0; i < new_size; ++i) {
Expand Down
6 changes: 3 additions & 3 deletions be/src/vec/common/space_saving.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ class SpaceSaving {

void read(BufferReadable& rb) {
destroy_elements();
size_t count = 0;
uint64_t count = 0;
read_var_uint(count, rb);

for (size_t i = 0; i < count; ++i) {
for (UInt64 i = 0; i < count; ++i) {
std::unique_ptr counter = std::make_unique<Counter>();
counter->read(rb);
counter->hash = counter_map.hash(counter->key);
Expand All @@ -259,7 +259,7 @@ class SpaceSaving {

// Reads the alpha map data from the provided readable buffer.
void read_alpha_map(BufferReadable& rb) {
size_t alpha_size = 0;
uint64_t alpha_size = 0;
read_var_uint(alpha_size, rb);
for (size_t i = 0; i < alpha_size; ++i) {
uint64_t alpha = 0;
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/exprs/table_function/vexplode_numbers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Status VExplodeNumbersTableFunction::process_init(Block* block, RuntimeState* st

((ColumnInt32*)_elements_column.get())->clear();
//_cur_size may be a negative number
_cur_size = std::max(0L, _cur_size);
_cur_size = std::max(static_cast<int64_t>(0L), _cur_size);
if (_cur_size &&
_cur_size <= state->batch_size()) { // avoid elements_column too big or empty
_is_const = true; // use const optimize
Expand Down
3 changes: 2 additions & 1 deletion be/src/vec/exprs/vruntimefilter_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class VRuntimeFilterWrapper final : public VExpr {
template <typename T>
static void judge_selectivity(double ignore_threshold, int64_t filter_rows, int64_t input_rows,
T& always_true) {
always_true = filter_rows / (input_rows * 1.0L) < ignore_threshold;
always_true = static_cast<double>(filter_rows) / static_cast<double>(input_rows)
< ignore_threshold;
}

bool is_rf_wrapper() const override { return true; }
Expand Down

0 comments on commit 7dd8c21

Please sign in to comment.