Skip to content

Commit

Permalink
Internal duckdb#330: Merge Sort Trees
Browse files Browse the repository at this point in the history
Fix CI issues (formatting, includes)
  • Loading branch information
hawkfish committed Oct 17, 2023
1 parent 4c155a2 commit 924d264
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/core_functions/aggregate/holistic/mode.cpp
Expand Up @@ -252,9 +252,8 @@ struct ModeFunction {
state.frequency_map = new typename STATE::Counts;
}
const double tau = .25;
if (state.nonzero <= tau * state.frequency_map->size() ||
prevs.back().end <= frames.front().start ||
frames.back().end <= prevs.front().start) {
if (state.nonzero <= tau * state.frequency_map->size() || prevs.back().end <= frames.front().start ||
frames.back().end <= prevs.front().start) {
state.Reset();
// for f ∈ F do
for (const auto &frame : frames) {
Expand Down
2 changes: 2 additions & 0 deletions src/execution/window_executor.cpp
Expand Up @@ -3,6 +3,8 @@
#include "duckdb/common/operator/add.hpp"
#include "duckdb/common/operator/subtract.hpp"

#include <array>

namespace duckdb {

static idx_t FindNextStart(const ValidityMask &mask, idx_t l, const idx_t r, idx_t &n) {
Expand Down
4 changes: 2 additions & 2 deletions src/execution/window_segment_tree.cpp
Expand Up @@ -264,8 +264,8 @@ class WindowCustomAggregatorState : public WindowAggregatorState {

WindowCustomAggregatorState::WindowCustomAggregatorState(const AggregateObject &aggr,
const WindowExcludeMode exclude_mode)
: aggr(aggr), state(aggr.function.state_size()),
statef(Value::POINTER(CastPointerToValue(state.data()))), frames(3, {0, 0}) {
: aggr(aggr), state(aggr.function.state_size()), statef(Value::POINTER(CastPointerToValue(state.data()))),
frames(3, {0, 0}) {
// if we have a frame-by-frame method, share the single state
aggr.function.initialize(state.data());

Expand Down
7 changes: 3 additions & 4 deletions src/include/duckdb/function/aggregate_function.hpp
Expand Up @@ -53,8 +53,7 @@ typedef void (*aggregate_simple_update_t)(Vector inputs[], AggregateInputData &a
//! The type used for computing complex/custom windowed aggregate functions (optional)
typedef void (*aggregate_window_t)(Vector inputs[], const ValidityMask &filter_mask,
AggregateInputData &aggr_input_data, idx_t input_count, data_ptr_t state,
const IncludedFrames &frames, Vector &result, idx_t rid,
const_data_ptr_t win_state);
const IncludedFrames &frames, Vector &result, idx_t rid, const_data_ptr_t win_state);

//! The type used for initializing shared complex/custom windowed aggregate state (optional)
typedef void (*aggregate_wininit_t)(Vector inputs[], AggregateInputData &aggr_input_data, idx_t input_count,
Expand Down Expand Up @@ -236,8 +235,8 @@ class AggregateFunction : public BaseScalarFunction {

template <class STATE, class INPUT_TYPE, class RESULT_TYPE, class OP>
static void UnaryWindow(Vector inputs[], const ValidityMask &filter_mask, AggregateInputData &aggr_input_data,
idx_t input_count, data_ptr_t state, const IncludedFrames &frames,
Vector &result, idx_t ridx, const_data_ptr_t gstate) {
idx_t input_count, data_ptr_t state, const IncludedFrames &frames, Vector &result,
idx_t ridx, const_data_ptr_t gstate) {
D_ASSERT(input_count == 1);
AggregateExecutor::UnaryWindow<STATE, INPUT_TYPE, RESULT_TYPE, OP>(inputs[0], filter_mask, aggr_input_data,
state, frames, result, ridx, gstate);
Expand Down

0 comments on commit 924d264

Please sign in to comment.