Skip to content

Commit

Permalink
add skeleton
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chien <stdrc@outlook.com>
  • Loading branch information
stdrc committed Apr 18, 2023
1 parent be50b16 commit 54e388d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/stream/src/executor/over_window/state/aggregate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2023 RisingWave Labs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use std::collections::VecDeque;

use risingwave_common::types::Datum;
use smallvec::SmallVec;

use super::{StateKey, StateOutput, StatePos, WindowState};

struct BufferEntry {
key: StateKey,
args: SmallVec<[Datum; 2]>,
}

pub(super) struct AggregateState {
buffer: VecDeque<BufferEntry>,
}

impl AggregateState {
pub fn new() -> Self {
Self {
buffer: Default::default(),
}
}
}

impl WindowState for AggregateState {
fn append(&mut self, key: StateKey, args: SmallVec<[Datum; 2]>) {
todo!()
}

fn curr_window(&self) -> StatePos<'_> {
todo!()
}

fn slide(&mut self) -> StateOutput {
todo!()
}
}
1 change: 1 addition & 0 deletions src/stream/src/executor/over_window/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use smallvec::SmallVec;

use super::MemcmpEncoded;

mod aggregate;
mod lag;
mod lead;

Expand Down

0 comments on commit 54e388d

Please sign in to comment.