discivigour opened a new pull request, #8770:
URL: https://github.com/apache/paimon/pull/8770
### Purpose
Fix query authorization handling in fallback reads and Chain Table batch
reads.
### Root cause
Query authorization wraps planned splits in `QueryAuthSplit`. Fallback reads
assumed the planned payload was always a `DataSplit`, and reader routing could
strip or misroute the authorization wrapper.
Chain Table batch planning also let the snapshot and delta branch scans
authorize their physical inputs independently before assembling the logical
`ChainSplit`. Besides exposing raw `QueryAuthSplit` values to `DataSplit`
casts, this could prune a historical snapshot anchor that is outside the
authorized logical partition but is required to reconstruct its final state.
Forwarding limit or TopN to these raw inputs could similarly discard data
before authorization was applied.
### Changes
- Preserve generic split wrappers through fallback planning and reader
routing.
- Disable query authorization only for the internal snapshot and delta
physical scans used by Chain Table batch planning.
- Assemble complete `ChainSplit` values first, then apply the logical table
authorization result once to the finished plan.
- Preserve the projected read type for the logical authorization request and
dynamically created physical scans.
- Avoid forwarding limit and TopN to raw Chain Table inputs while query
authorization is enabled.
- Inspect one `QueryAuthSplit` layer for reader dispatch while passing the
original wrapper to the data reader so row filtering and column masking still
execute.
- Add regression coverage for fallback routing, logical Chain Table
authorization, historical anchors, limit/TopN handling, serialization, and
masking.
This change is limited to fallback reads and Chain Table batch reads; it
does not change Chain Table streaming behavior.
### Tests
```shell
mvn -pl paimon-core -am -Pfast-build -DfailIfNoTests=false \
-DwildcardSuites=none \
'-Dtest=ChainGroupReadTableTest,ChainTableFileStoreTableTest,FallbackReadFileStoreTableTest#testPlanAndReadWithQueryAuthSplit'
\
-Dmaven.repo.local=/opt/homebrew/opt/maven/repository test
```
Result: 7 tests passed.
```shell
mvn -pl paimon-core -DskipTests \
-Dmaven.repo.local=/opt/homebrew/opt/maven/repository validate
```
Result: Checkstyle, Spotless, and Maven Enforcer passed.
--
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]