Skip to content

Commit

Permalink
Support all equality predicates in equality join (#4193)
Browse files Browse the repository at this point in the history
* Support normal expressions in equality join

* Add some tests

* Improve comment

* Update datafusion/sql/src/planner.rs

Co-authored-by: Andrew Lamb <[email protected]>

* Add another test case

* Add comment

* fix typo

* remove dumplicated keys in projection and add test cases

* fix comment

* fix typo

Co-authored-by: Andrew Lamb <[email protected]>
  • Loading branch information
ygf11 and alamb authored Nov 17, 2022
1 parent 062acad commit 822022d
Show file tree
Hide file tree
Showing 2 changed files with 353 additions and 42 deletions.
12 changes: 12 additions & 0 deletions datafusion/expr/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,18 @@ pub fn can_hash(data_type: &DataType) -> bool {
}
}

/// Check whether all columns are from the schema.
pub fn check_all_column_from_schema(
columns: &HashSet<Column>,
schema: DFSchemaRef,
) -> Result<bool> {
let result = columns
.iter()
.all(|column| schema.index_of_column(column).is_ok());

Ok(result)
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
Loading

0 comments on commit 822022d

Please sign in to comment.