Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Outer joins for native executor #2860

Merged
merged 16 commits into from
Oct 22, 2024
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/arrow2/src/bitmap/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,25 @@
pub(crate) fn bitchunks_exact_mut<T: BitChunk>(&mut self) -> BitChunksExactMut<T> {
BitChunksExactMut::new(&mut self.buffer, self.length)
}

pub fn or(&self, other: &MutableBitmap) -> MutableBitmap {
colin-ho marked this conversation as resolved.
Show resolved Hide resolved
assert_eq!(
self.length, other.length,
"Bitmaps must have the same length"

Check warning on line 332 in src/arrow2/src/bitmap/mutable.rs

View check run for this annotation

Codecov / codecov/patch

src/arrow2/src/bitmap/mutable.rs#L332

Added line #L332 was not covered by tests
);

let new_buffer: Vec<u8> = self
colin-ho marked this conversation as resolved.
Show resolved Hide resolved
.buffer
.iter()
.zip(other.buffer.iter())
.map(|(&a, &b)| a | b) // Apply bitwise OR on each pair of bytes
.collect();

MutableBitmap {
buffer: new_buffer,
length: self.length,
}
}
}

impl From<MutableBitmap> for Bitmap {
Expand Down
1 change: 1 addition & 0 deletions src/daft-local-execution/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[dependencies]
arrow2 = {workspace = true}
colin-ho marked this conversation as resolved.
Show resolved Hide resolved
common-daft-config = {path = "../common/daft-config", default-features = false}
common-display = {path = "../common/display", default-features = false}
common-error = {path = "../common/error", default-features = false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ impl IntermediateOperatorState for AntiSemiProbeState {

pub struct AntiSemiProbeOperator {
probe_on: Vec<ExprRef>,
join_type: JoinType,
is_semi: bool,
}

impl AntiSemiProbeOperator {
pub fn new(probe_on: Vec<ExprRef>, join_type: JoinType) -> Self {
pub fn new(probe_on: Vec<ExprRef>, join_type: &JoinType) -> Self {
Self {
probe_on,
join_type,
is_semi: *join_type == JoinType::Semi,
}
}

Expand All @@ -76,7 +76,7 @@ impl AntiSemiProbeOperator {
let iter = probe_set.probe_exists(&join_keys)?;

for (probe_row_idx, matched) in iter.enumerate() {
match (self.join_type == JoinType::Semi, matched) {
match (self.is_semi, matched) {
(true, true) | (false, false) => {
probe_side_growable.extend(probe_side_table_idx, probe_row_idx, 1);
}
Expand Down Expand Up @@ -120,10 +120,7 @@ impl IntermediateOperator for AntiSemiProbeOperator {
.downcast_mut::<AntiSemiProbeState>()
.expect("AntiSemiProbeOperator state should be AntiSemiProbeState");
let input = input.as_data();
let out = match self.join_type {
JoinType::Semi | JoinType::Anti => self.probe_anti_semi(input, state),
_ => unreachable!("Only Semi and Anti joins are supported"),
}?;
let out = self.probe_anti_semi(input, state)?;
Ok(IntermediateOperatorResult::NeedMoreInput(Some(out)))
}
}
Expand Down
273 changes: 0 additions & 273 deletions src/daft-local-execution/src/intermediate_ops/hash_join_probe.rs

This file was deleted.

Loading
Loading