Skip to content

fix: report unsupported time travel instead of returning current data - #753

Draft
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:time-travel-not-silently-dropped
Draft

fix: report unsupported time travel instead of returning current data#753
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:time-travel-not-silently-dropped

Conversation

@plusplusjiajia

@plusplusjiajia plusplusjiajia commented Aug 26, 2026

Copy link
Copy Markdown
Member

Purpose

PaimonRelationPlanner handed every version clause it did not recognize back to DataFusion, which drops it. FOR SYSTEM_TIME AS OF on a Paimon table therefore planned against the current snapshot, so an explicitly historical query returned today's rows.

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. 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. 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
plusplusjiajia marked this pull request as ready for review August 26, 2026 15:43
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
plusplusjiajia force-pushed the time-travel-not-silently-dropped branch from 8799e43 to a8560c6 Compare August 30, 2026 14:19
@plusplusjiajia
plusplusjiajia marked this pull request as draft August 30, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant