Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
actually add filter skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
connortsui20 committed Feb 25, 2024
1 parent 3cde2d8 commit 4edfd0e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions eggstrain/src/execution/operators/filter.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
use super::{Operator, UnaryOperator};
use arrow::record_batch::RecordBatch;
use async_trait::async_trait;
use datafusion::physical_plan::ExecutionPlan;
use std::sync::Arc;
use tokio::sync::broadcast;

pub struct Filter {
pub children: Vec<Arc<dyn ExecutionPlan>>,
}

impl Operator for Filter {
fn children(&self) -> Vec<Arc<dyn ExecutionPlan>> {
self.children.clone()
}
}

#[async_trait]
impl UnaryOperator for Filter {
type In = RecordBatch;
type Out = RecordBatch;

fn into_unary(self) -> Arc<dyn UnaryOperator<In = Self::In, Out = Self::Out>> {
Arc::new(self)
}

async fn execute(
&self,
mut rx: broadcast::Receiver<Self::In>,
tx: broadcast::Sender<Self::Out>,
) {
todo!()
}
}

0 comments on commit 4edfd0e

Please sign in to comment.