fn plan_dbz_flatten_one(
    input: HirRelationExpr,
    bare_column: usize,
    diff: i64,
    n_flattened_cols: usize,
) -> HirRelationExpr {
    HirRelationExpr::Map {
        input: Box::new(HirRelationExpr::Filter {
            input: Box::new(input),
            predicates: vec![HirScalarExpr::CallUnary {
                func: UnaryFunc::Not(func::Not),
                expr: Box::new(HirScalarExpr::CallUnary {
                    func: UnaryFunc::IsNull(func::IsNull),
                    expr: Box::new(HirScalarExpr::Column(ColumnRef {
                        level: 0,
                        column: bare_column,
                    })),
                }),
            }],
        }),
        scalars: (0..n_flattened_cols)
            .into_iter()
            .map(|idx| HirScalarExpr::CallUnary {
                func: UnaryFunc::RecordGet(idx),
                expr: Box::new(HirScalarExpr::Column(ColumnRef {
                    level: 0,
                    column: bare_column,
                })),
            })
            .chain(iter::once(HirScalarExpr::Literal(
                Row::pack(iter::once(Datum::Int64(diff))),
                ColumnType {
                    nullable: false,
                    scalar_type: ScalarType::Int64,
                },
            )))
            .collect(),
    }
}
// Flatten one Debezium entry ("before" or "after")
// into its corresponding data fields, plus an extra column for the diff.
Flatten one Debezium entry ("before" or "after")
into its corresponding data fields, plus an extra column for the diff.
Flatten one Debezium entry ( " before " or " after " ) into its corresponding data fields plus an extra column for the diff .
fn plan_dbz_flatten_one(
    input: HirRelationExpr,
    bare_column: usize,
    diff: i64,
    n_flattened_cols: usize,
) -> HirRelationExpr {
    HirRelationExpr::Map {
        input: Box::new(HirRelationExpr::Filter {
            input: Box::new(input),
            predicates: vec![HirScalarExpr::CallUnary {
                func: UnaryFunc::Not(func::Not),
                expr: Box::new(HirScalarExpr::CallUnary {
                    func: UnaryFunc::IsNull(func::IsNull),
                    expr: Box::new(HirScalarExpr::Column(ColumnRef {
                        level: 0,
                        column: bare_column,
                    })),
                }),
            }],
        }),
        scalars: (0..n_flattened_cols)
            .into_iter()
            .map(|idx| HirScalarExpr::CallUnary {
                func: UnaryFunc::RecordGet(idx),
                expr: Box::new(HirScalarExpr::Column(ColumnRef {
                    level: 0,
                    column: bare_column,
                })),
            })
            .chain(iter::once(HirScalarExpr::Literal(
                Row::pack(iter::once(Datum::Int64(diff))),
                ColumnType {
                    nullable: false,
                    scalar_type: ScalarType::Int64,
                },
            )))
            .collect(),
    }
}
fn plan_dbz_flatten_one ( input : HirRelationExpr , bare_column : usize , diff : i64 , n_flattened_cols : usize , ) -> HirRelationExpr { HirRelationExpr :: Map { input : Box :: new ( HirRelationExpr :: Filter { input : Box :: new ( input ) , predicates : vec ! [ HirScalarExpr CallUnary { func UnaryFunc Not ( func Not ) expr Box new ( HirScalarExpr CallUnary { func UnaryFunc IsNull ( func IsNull ) expr Box new ( HirScalarExpr Column ( ColumnRef { level 0 column bare_column } ) ) } ) } ] , } ) , scalars : ( 0 .. n_flattened_cols ) . into_iter ( ) . map ( | idx | HirScalarExpr :: CallUnary { func : UnaryFunc :: RecordGet ( idx ) , expr : Box :: new ( HirScalarExpr :: Column ( ColumnRef { level : 0 , column : bare_column , } ) ) , } ) . chain ( iter :: once ( HirScalarExpr :: Literal ( Row :: pack ( iter :: once ( Datum :: Int64 ( diff ) ) ) , ColumnType { nullable : false , scalar_type : ScalarType :: Int64 , } , ) ) ) . collect ( ) , } }
Flatten one Debezium entry ("before" or "after")
into its corresponding data fields, plus an extra column for the diff.
Flatten one Debezium entry ( " before " or " after " ) into its corresponding data fields plus an extra column for the diff .
input
HirRelationExpr
bare_column
usize
diff
i64
n_flattened_cols
usize
input
HirRelationExpr
bare_column
usize
diff
i64
n_flattened_cols
usize