plusplusjiajia opened a new pull request, #753:
URL: https://github.com/apache/paimon-rust/pull/753
### Purpose
PaimonRelationPlanner handed every version clause it did not recognize back
to DataFusion, which drops it: FOR SYSTEM_TIME AS OF planned against the
current snapshot, so an explicitly historical query returned today's rows.
System tables and views were dropped the same way — each has a provider of its
own, so the downcast missed them and even VERSION AS OF over t$files was
ignored.
Reachable from a plain SessionContext with a dialect that parses version
clauses. SQLContext resolves them before planning and is unaffected.
### Brief change log
- Error on a version clause this planner cannot resolve, instead of
returning the relation unchanged.
- Mark system tables and views with PaimonOwnedProvider and refuse time
travel over them: this planner rewrites a table onto another snapshot, and
there is no equivalent for something built over one. A marker
rather than the name, since another engine may hold a table called x$files.
- A genuinely foreign provider still falls through untouched — relation
planners are session-global.
- The read path classifies through load_table, so a table a query engine
must serve reports its declared type at load time rather than deeper in the
scan.
### Tests
- time_travel_on_a_system_table_is_rejected_in_a_raw_session
- a_foreign_table_named_like_a_system_table_is_left_alone — same $files
name, opposite outcome, which is what pins the discriminator.
### API and Format
No public API change(PaimonOwnedProvider 是 pub(crate)),no format change.
### Documentation
None needed.
--
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]