Repository navigation
[spark] Do not merge scalar subqueries that read different columns of a query-auth table - #11427
Open
LuciferYang wants to merge 1 commit into
Open
LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
… a query-auth table
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
Fixes #11426.
MergePaimonScalarSubqueriesmerges two scans of a Paimon table that differ only in the columns they read into one scan over both sets of columns. For a table withquery-auth.enabled, the scan sends the columns it reads to the catalog'sauthTableQuery, which returns the row filters and column masks for those columns. A merged scan asks about the union of columns, whose rules need not match what each subquery would get. Spark 3.3 to 4.3 run this rule.With this PR,
mergePaimonScanno longer merges such scans when the table's options enable query auth. Scans that read the same columns still merge. The check sees the option whether it comes from the table, aspark.paimon.*session config or a read option.On 4.3, #11425 replaces the rule with Spark's own scan merging, which keeps query-auth tables out unless only a read option enables it.
Tests
MergeScalarSubqueriesQueryAuthTestBasein paimon-spark-ut runs against the REST catalog test server, with a subclass in each of the 3.3 to 4.2 modules:mergePaimonScanmerges identical Paimon scans, so this case fails if the check moves above the equality test.SCAN_MERGING, which it does on Spark 4.3 after [spark] Let Spark 4.3 merge scalar subqueries over Paimon tables #11425.