Skip to content

Commit

Permalink
chore(planner): merge into prune row_id if insert_only (#13951)
Browse files Browse the repository at this point in the history
merge into prune row_id if insert_only

Co-authored-by: JackTan25 <[email protected]>
  • Loading branch information
Dousir9 and JackTan25 authored Dec 7, 2023
1 parent 341ebe8 commit 47014c8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/query/sql/src/planner/binder/merge_into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ use crate::ScalarBinder;
use crate::ScalarExpr;
use crate::Visibility;

#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum MergeIntoType {
MatechedOnly,
FullOperation,
Expand Down Expand Up @@ -297,8 +297,11 @@ impl Binder {
self.metadata
.write()
.set_table_row_id_index(table_index, column_binding.index);

// add row_id_idx
columns_set.insert(column_binding.index);
if merge_type != MergeIntoType::InsertOnly {
columns_set.insert(column_binding.index);
}

// add join, we use _row_id to check_duplicate join row.
let join = Join {
Expand Down

0 comments on commit 47014c8

Please sign in to comment.