This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e724f92
commit 68a0f63
Showing
10 changed files
with
188 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
use arrow::array::RecordBatch; | ||
use crossbeam_skiplist::SkipMap; | ||
use crossbeam_utils::thread::scope; | ||
use datafusion::physical_plan::joins::hash_join::JoinLeftData; | ||
|
||
use core::panic; | ||
use std::collections::HashMap; | ||
use std::hash::Hash; | ||
use std::sync::Arc; | ||
pub enum Blob { | ||
// RecordBatchBlob(Vec<RecordBatch>), | ||
HashMapBlob(JoinLeftData), | ||
} | ||
|
||
impl Blob { | ||
pub fn get_map(self) -> JoinLeftData { | ||
match self { | ||
Blob::HashMapBlob(m) => m, | ||
_ => panic!("error"), | ||
} | ||
} | ||
// pub fn get_records(self) -> Vec<RecordBatch> { | ||
// match self { | ||
// Blob::RecordBatchBlob(records) => records, | ||
// _ => panic!("error"), | ||
// } | ||
// } | ||
// pub fn append_records(&mut self, batches: Vec<RecordBatch>) { | ||
// match self { | ||
// Blob::RecordBatchBlob(records) => { | ||
// // TODO: check if schema is same | ||
// records.extend(batches) | ||
// } | ||
// _ => panic!("error"), | ||
// } | ||
// } | ||
} | ||
|
||
// right now this is typedef of HashMap<i32, Blob>, | ||
// but we may need something else in near future | ||
|
||
pub struct Store { | ||
store: HashMap<i32, Blob>, | ||
} | ||
impl Store { | ||
pub fn new() -> Store { | ||
Store { | ||
store: HashMap::new(), | ||
} | ||
} | ||
pub fn insert(&mut self, key: i32, value: Blob) { | ||
self.store.insert(key, value); | ||
} | ||
// pub fn append(&mut self, key: i32, value: Vec<RecordBatch>) { | ||
// let blob = self.remove(key); | ||
// let mut blob = match blob { | ||
// Some(r) => r, | ||
// None => Blob::RecordBatchBlob(Vec::new()), | ||
// }; | ||
// blob.append_records(value); | ||
// self.store.insert(key, blob); | ||
// } | ||
pub fn remove(&mut self, key: i32) -> Option<Blob> { | ||
self.store.remove(&key) | ||
// let x = self.store.remove(&key).unwrap().value(); | ||
// Some(x) | ||
} | ||
} | ||
pub struct Store1 { | ||
store: SkipMap<i32, i32>, | ||
} | ||
impl Store1 { | ||
pub fn new() -> Self { | ||
Store1 { | ||
store: SkipMap::new(), | ||
} | ||
} | ||
pub fn insert(&mut self, key: i32, value: i32) { | ||
self.store.insert(key, value); | ||
} | ||
// pub fn append(&mut self, key: i32, value: Vec<RecordBatch>) { | ||
// let blob = self.remove(key); | ||
// let mut blob = match blob { | ||
// Some(r) => r, | ||
// None => Blob::RecordBatchBlob(Vec::new()), | ||
// }; | ||
// blob.append_records(value); | ||
// self.store.insert(key, blob); | ||
// } | ||
// pub fn remove(&mut self, key: i32) -> &Option<Arc<Blob>> { | ||
// let value = self.store.remove(&key).unwrap().value(); | ||
// Some(value.un) | ||
// // let x = self.store.remove(&key).unwrap().value(); | ||
// // Some(x) | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1 @@ | ||
use crate::operators::filter::FilterOperator; | ||
use crate::operators::join::HashProbeOperator; | ||
use crate::operators::projection::ProjectionOperator; | ||
use crate::pipeline; | ||
use crate::store::Store; | ||
use arrow::array::BooleanBufferBuilder; | ||
use core::panic; | ||
use datafusion::arrow::array::RecordBatch; | ||
use datafusion::datasource::physical_plan::CsvExec; | ||
use datafusion::error::Result; | ||
use datafusion::execution::context::SessionContext; | ||
use datafusion::execution::SendableRecordBatchStream; | ||
use datafusion::physical_plan::coalesce_batches::CoalesceBatchesExec; | ||
use datafusion::physical_plan::filter::FilterExec; | ||
use datafusion::physical_plan::joins::hash_join::BuildSide; | ||
use datafusion::physical_plan::joins::hash_join::BuildSideReadyState; | ||
use datafusion::physical_plan::joins::HashJoinExec; | ||
use datafusion::physical_plan::projection::ProjectionExec; | ||
use datafusion::physical_plan::repartition::RepartitionExec; | ||
use datafusion::physical_plan::ExecutionPlan; | ||
use datafusion::prelude::SessionConfig; | ||
use std::sync::Arc; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.