You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: physical_join.rs
    path of file: ./repos/databend/src/query/sql/src/executor/physical_plans
    
    the code of the file until where you have to start completion: // Copyright 2021 Datafuse Labs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific langua
    
pub fn physical_join(join: &Join, s_expr: &SExpr) -> Result<PhysicalJoinType> {
    if !join.left_conditions.is_empty() {
        // Contain equi condition, use hash join
        return Ok(PhysicalJoinType::Hash);
    }

    let left_prop = RelExpr::with_s_expr(s_expr.child(1)?).derive_relational_prop()?;
    let right_prop = RelExpr::with_s_expr(s_expr.child(0)?).derive_relational_prop()?;
    let mut range_conditions = vec![];
    let mut other_conditions = vec![];
    for condition in join.non_equi_conditions.iter() {
        check_condition(
            condition,
            &left_prop,
            &right_prop,
            &mut range_conditions,
            &mut other_conditions,
        )
    }

    if !range_conditions.is_empty() && matches!(join.join_type, JoinType::Inner | JoinType::Cross) {
        return Ok(PhysicalJoinType::RangeJoin(
            range_conditions,
            other_conditions,
        ));
    }

    // Leverage hash join to execute nested loop join
    Ok(PhysicalJoinType::Hash)
}