Join this `DataFrame` with another `DataFrame` using explicitly specified columns and an optional filter expression. See [`join_on`](Self::join_on) for a more concise way to specify the join condition. Since DataFusion will automatically identify and optimize equality predicates there is no performance difference between this function and `join_on` `left_cols` and `right_cols` are used to form "
(
self,
right: DataFrame,
join_type: JoinType,
left_cols: &[&str],
right_cols: &[&str],
filter: Option<Expr>,
)
| 1280 | /// # } |
| 1281 | /// ``` |
| 1282 | pub fn join( |
| 1283 | self, |
| 1284 | right: DataFrame, |
| 1285 | join_type: JoinType, |
| 1286 | left_cols: &[&str], |
| 1287 | right_cols: &[&str], |
| 1288 | filter: Option<Expr>, |
| 1289 | ) -> Result<DataFrame> { |
| 1290 | let plan = LogicalPlanBuilder::from(self.plan) |
| 1291 | .join( |
| 1292 | right.plan, |
| 1293 | join_type, |
| 1294 | (left_cols.to_vec(), right_cols.to_vec()), |
| 1295 | filter, |
| 1296 | )? |
| 1297 | .build()?; |
| 1298 | Ok(DataFrame { |
| 1299 | session_state: self.session_state, |
| 1300 | plan, |
| 1301 | projection_requires_validation: true, |
| 1302 | }) |
| 1303 | } |
| 1304 | |
| 1305 | /// Join this `DataFrame` with another `DataFrame` using the specified |
| 1306 | /// expressions. |