Repository navigation
[spark] Let Spark 4.3 merge scalar subqueries over Paimon tables - #11425
Open
LuciferYang wants to merge 1 commit into
Open
LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
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 #11424.
On Spark 4.3,
MergePaimonScalarSubqueriesruns before Spark'sMergeSubplanson every query, including ones that read no Paimon table. It is an old copy of Spark's rule without its later fixes: it returns a wrong sum for a CSV read, throws on some nested-subquery, struct and CTE queries, and theWithCTEit adds makesMergeSubplansskip the query.Spark 4.3 merges DSv2 scans itself for tables that declare
TableCapability.SCAN_MERGING(SPARK-40259). On 4.3 only, this PR uses the no-op rule from paimon-spark-common, andPaimonScanMergingdeclaresSCAN_MERGINGfor aFileStoreTableunless its options enable query auth. With query auth, the catalog's row filters can depend on the columns read.4.3 then no longer merges subqueries that read different columns of a query-auth table or the same pruned struct field. On Spark 3.3 to 4.2 the old rule still merges query-auth tables; #11427 fixes that.
Tests
Spark43ScanMergingTestin the 4.3 module:SCAN_MERGING; three system tables and query-auth tables do not.