fix: report unsupported time travel instead of returning current data - #753
Draft
plusplusjiajia wants to merge 1 commit into
Draft
fix: report unsupported time travel instead of returning current data#753plusplusjiajia wants to merge 1 commit into
plusplusjiajia wants to merge 1 commit into
Conversation
PaimonRelationPlanner handed every version clause it did not recognize back to DataFusion unchanged, so a clause like FOR SYSTEM_TIME AS OF on a Paimon table planned against the current snapshot: an explicitly historical query quietly returned today's rows. Only recognized clauses pass now; anything else is an error naming the supported syntax. The provider downcast moves ahead of the clause match so a genuinely foreign provider still falls through untouched -- relation planners are session-global, and another engine's tables have to keep working. The read path classifies through load_table as well, so referencing a table that a query engine must serve reports the declared type at load time rather than failing deeper in the scan. Object tables and any variant added later are refused there: that path exists for branches, time travel and system tables, none of which they have.
plusplusjiajia
force-pushed
the
time-travel-not-silently-dropped
branch
from
August 30, 2026 14:19
8799e43 to
a8560c6
Compare
plusplusjiajia
marked this pull request as draft
August 30, 2026 14:38
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
PaimonRelationPlannerhanded every version clause it did not recognize back to DataFusion, which drops it.FOR SYSTEM_TIME AS OFon a Paimon table therefore planned against the current snapshot, so an explicitly historical query returned today's rows.Reachable from a plain
SessionContextwith a dialect that parses version clauses.SQLContextresolves them before planning and is unaffected.Brief change log
load_table, so a table a query engine must serve reports its declared type at load time rather than deeper in the scan. Object tables, and any variant added later, are refused there: that path exists for branches, time travel and system tables, none of which they have.