Skip to content

Commit

Permalink
fix changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
xxhZs committed Jul 1, 2024
1 parent 4f1c89c commit bc60958
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/frontend/src/optimizer/plan_node/logical_changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,26 @@ impl PlanTreeNodeUnary for LogicalChangeLog {
input_col_change: ColIndexMapping,
) -> (Self, ColIndexMapping) {
let changelog = Self::new(input, self.core.need_op, true);
if self.core.need_op {

let out_col_change = if self.core.need_op {
let mut output_vec = input_col_change.to_parts().0.to_vec();
let len = input_col_change.to_parts().1;
output_vec.push(Some(len));
let out_col_change = ColIndexMapping::new(output_vec, len + 1);
(changelog, out_col_change)
ColIndexMapping::new(output_vec, len + 1)
} else {
(changelog, input_col_change)
}
input_col_change
};

let mut output_vec = out_col_change.to_parts().0.to_vec();
let len = out_col_change.to_parts().1;
let out_col_change = if self.base.stream_key().is_none() {
ColIndexMapping::new(output_vec, len + 1)
}else{
output_vec.push(Some(len));
ColIndexMapping::new(output_vec, len + 1)
};

(changelog, out_col_change)
}
}

Expand Down

0 comments on commit bc60958

Please sign in to comment.