Repository navigation
[python] Require full table access in Ray merge_into - #10902
Merged
JingsongLi merged 1 commit intoNov 1, 2026
Merged
JingsongLi merged 1 commit into
JingsongLi merged 1 commit into
Conversation
plusplusjiajia
marked this pull request as ready for review
October 31, 2026 02:32
The Ray Data Evolution merge_into did not check query auth before merging. Matched updates and deletes were refused later, but a merge with only WHEN NOT MATCHED read the target keys through the filtered and masked read, so keys hidden by the row filter or masked on the ON column looked unmatched and were inserted again. A source given as a table name was also read through its filtered and masked read, so the masked values were written into the target as real data. As in the local and native merge, merge_into now requires full access to the target, and to a source given as a table name, before anything is read or written.
plusplusjiajia
force-pushed
the
fix/python-ray-merge-into-query-auth
branch
from
October 31, 2026 03:28
023488d to
326ef74
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The Ray Data Evolution
merge_intodid not check query auth before merging, unlike the local and native merge and the other update paths, which require full access to the table (_authorize_update).WHEN NOT MATCHEDread the target keys through the filtered and masked read, so keys hidden by the row filter, or masked on theONcolumn, looked unmatched and were inserted again as duplicates.merge_intonow requires full access to the target, and to a source given as a table name, before anything is read or written, as the local merge does.Tests
test_insert_only_merge_authorizes_target_before_source: an insert-only merge into a target that is denied, row filtered or masked on theONkey, with and without existing rows, is refused before the source, the snapshot or any assignment is read, and no files are written.test_merge_authorizes_named_source_separately: a row filtered or masked source table is refused after the target is authorized, and nothing is written.test_merge_with_full_source_and_target_grants: with full access to both tables the merge still updates and inserts.ray_data_evolution_merge_into_test.py, and 223 passed innative_authorized_update_test.py,table_merge_into_test.pyandtable_query_auth_test.py. flake8 is clean.