MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / join

Method join

src/sql/src/plan/hir.rs:1936–1970  ·  view source on GitHub ↗
(
        self,
        mut right: HirRelationExpr,
        on: HirScalarExpr,
        kind: JoinKind,
    )

Source from the content-addressed store, hash-verified

1934 }
1935
1936 pub fn join(
1937 self,
1938 mut right: HirRelationExpr,
1939 on: HirScalarExpr,
1940 kind: JoinKind,
1941 ) -> HirRelationExpr {
1942 if self.is_join_identity()
1943 && !right.is_correlated()
1944 && on == HirScalarExpr::literal_true()
1945 && kind.can_elide_identity_left_join()
1946 {
1947 // The join can be elided, but we need to adjust column references
1948 // on the right-hand side to account for the removal of the scope
1949 // introduced by the join.
1950 #[allow(deprecated)]
1951 right.visit_columns_mut(0, &mut |depth, col| {
1952 if col.level > depth {
1953 col.level -= 1;
1954 }
1955 });
1956 right
1957 } else if right.is_join_identity()
1958 && on == HirScalarExpr::literal_true()
1959 && kind.can_elide_identity_right_join()
1960 {
1961 self
1962 } else {
1963 HirRelationExpr::Join {
1964 left: Box::new(self),
1965 right: Box::new(right),
1966 on,
1967 kind,
1968 }
1969 }
1970 }
1971
1972 pub fn take(&mut self) -> HirRelationExpr {
1973 mem::replace(

Callers 15

hintMethod · 0.45
fmtMethod · 0.45
plan_select_from_whereFunction · 0.45
plan_rows_from_internalFunction · 0.45
plan_joinFunction · 0.45
plan_using_constraintFunction · 0.45
key_constraint_errFunction · 0.45
plan_create_indexFunction · 0.45
formatMethod · 0.45
get_min_lsnsFunction · 0.45

Calls 5

is_join_identityMethod · 0.80
is_correlatedMethod · 0.80
visit_columns_mutMethod · 0.80

Tested by 7

get_min_lsnsFunction · 0.36
snapshotFunction · 0.36
test_datadrivenFunction · 0.36