BiteTheDDDDt opened a new pull request, #65853:
URL: https://github.com/apache/doris/pull/65853

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #38527
   
   Problem Summary:
   
   When a query is rewritten to a synchronous materialized view whose RANGE 
partition column is aliased, the runtime filter is applied to the MV scan but 
runtime-filter partition pruning is not enabled. The synchronous MV column has 
a rollup-local physical name and unique ID, while partition metadata still uses 
the base-table column. FE therefore rejects the target as a partition column 
and fails to bind serialized partition boundaries to the MV scan slot.
   
   The query result remains correct, but all partitions and tablets are 
scanned. In the reproduced case, the MV path created 8 scanners with zero 
partition-pruning counters, while disabling the MV pruned 3 of 4 partitions and 
6 of 8 tablets.
   
   This change recovers the base-column lineage from a simple synchronous MV 
`SlotRef` definition in both the RF partition-pruning classifier and 
partition-boundary slot mapping. The MV remains selected and BE can prune 
partitions before scanner creation.
   
   After the change on the reproduced query:
   
   - `TotalPartitionsForRFPruning`: 4
   - `PartitionsPrunedByRuntimeFilter`: 3
   - `TabletsPrunedByRuntimeFilter`: 6
   - `NumScanners`: 2
   - Query result remains `100 / 596100`
   
   ### Release note
   
   Support runtime filter partition pruning for synchronous materialized views 
with aliased partition columns.
   
   ### Check List (For Author)
   
   - Test: Regression test / Unit Test / Manual test
       - FE unit test: `RuntimeFilterPartitionPruneClassifierTest` (7 tests 
passed)
       - Regression test: `query_p0/runtime_filter/rf_partition_pruning` (1 
suite passed)
       - Manual test: verified the reproduced query on a local cluster
       - Build: `./build.sh --fe`
   - Behavior changed: Yes. Eligible runtime filters can now prune base-table 
partitions when scanning a synchronous MV alias.
   - Does this need documentation: No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to