Skip to content

Commit a088d6c

Browse files
committed
Create marker column in pyarrow instead of Python list first
1 parent 8e32e9c commit a088d6c

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

pyiceberg/table/upsert_util.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ def get_rows_to_update(source_table: pa.Table, target_table: pa.Table, join_cols
117117
)
118118

119119
# Step 2: Prepare target index with join keys and a marker
120-
target_index = target_table.select(join_cols_set).append_column(
121-
MARKER_COLUMN_NAME, pa.array([True] * len(target_table), pa.bool_())
122-
)
120+
target_index = target_table.select(join_cols_set).append_column(MARKER_COLUMN_NAME, pa.repeat(True, len(target_table)))
123121

124122
# Step 3: Perform a left outer join to find which rows from source exist in target
125123
joined = source_index.join(target_index, keys=list(join_cols_set), join_type="left outer")

0 commit comments

Comments
 (0)