-
Notifications
You must be signed in to change notification settings - Fork 49
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
Showing
19 changed files
with
358 additions
and
51 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
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
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,45 @@ | ||
use crate::errors::DatabaseError; | ||
use crate::execution::volcano::{build_read, BoxedExecutor, ReadExecutor}; | ||
use crate::planner::LogicalPlan; | ||
use crate::storage::Transaction; | ||
use crate::types::tuple::Tuple; | ||
use futures_async_stream::try_stream; | ||
|
||
pub struct Union { | ||
left_input: LogicalPlan, | ||
right_input: LogicalPlan, | ||
} | ||
|
||
impl From<(LogicalPlan, LogicalPlan)> for Union { | ||
fn from((left_input, right_input): (LogicalPlan, LogicalPlan)) -> Self { | ||
Union { | ||
left_input, | ||
right_input, | ||
} | ||
} | ||
} | ||
|
||
impl<T: Transaction> ReadExecutor<T> for Union { | ||
fn execute(self, transaction: &T) -> BoxedExecutor { | ||
self._execute(transaction) | ||
} | ||
} | ||
|
||
impl Union { | ||
#[try_stream(boxed, ok = Tuple, error = DatabaseError)] | ||
pub async fn _execute<T: Transaction>(self, transaction: &T) { | ||
let Union { | ||
left_input, | ||
right_input, | ||
} = self; | ||
|
||
#[for_await] | ||
for tuple in build_read(left_input, transaction) { | ||
yield tuple?; | ||
} | ||
#[for_await] | ||
for tuple in build_read(right_input, transaction) { | ||
yield tuple?; | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.