mod build;
pub mod columnar;
mod inner;
mod outer;
#[cfg(test)]
mod tests;
pub(super) use build::build_existence_hash_table_parallel;
pub(super) use inner::{hash_join_inner, hash_join_inner_arithmetic, hash_join_inner_multi};
pub(super) use outer::{
hash_join_left_outer, hash_join_left_outer_multi, hash_join_left_outer_with_filter,
};
pub(super) use super::FromResult;
pub(super) fn batch_combine_rows_with_table_names(
build_rows: &[vibesql_storage::Row],
probe_rows: &[vibesql_storage::Row],
join_pairs: &[(usize, usize)],
left_is_build: bool,
build_table_names: &[String],
probe_table_names: &[String],
) -> Vec<vibesql_storage::Row> {
if join_pairs.is_empty() {
return Vec::new();
}
let mut result_rows = Vec::with_capacity(join_pairs.len());
let (left_table_names, right_table_names) = if left_is_build {
(build_table_names, probe_table_names)
} else {
(probe_table_names, build_table_names)
};
for &(build_idx, probe_idx) in join_pairs {
let build_row = &build_rows[build_idx];
let probe_row = &probe_rows[probe_idx];
let result_row = if left_is_build {
vibesql_storage::Row::combine_for_join(
build_row,
probe_row,
left_table_names,
right_table_names,
)
} else {
vibesql_storage::Row::combine_for_join(
probe_row,
build_row,
left_table_names,
right_table_names,
)
};
result_rows.push(result_row);
}
result_rows
}