Skip to content

fix(datafusion): skip view lookup for table functions#518

Merged
jerry-024 merged 1 commit into
apache:mainfrom
shyjsarah:fix/skip-view-resolution-for-table-functions
Jul 13, 2026
Merged

fix(datafusion): skip view lookup for table functions#518
jerry-024 merged 1 commit into
apache:mainfrom
shyjsarah:fix/skip-view-resolution-for-table-functions

Conversation

@shyjsarah

@shyjsarah shyjsarah commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: N/A (hotfix for a regression introduced by #494)

DataFusion preloads relation names before planning. For a query such as FROM vector_search(...), it may first ask the current schema for a table named vector_search. After REST view support was added, a missing table was reinterpreted as a view, so an error from get_view could abort planning before DataFusion resolved the registered table function.

This change prevents registered table functions from being incorrectly resolved as REST catalog views.

Brief change log

  • Skip REST view fallback when a missing relation name matches a registered table function.
  • Keep ordinary table and REST view resolution unchanged.
  • Add a regression test using the built-in vector_search table function and a generic REST catalog.

Tests

  • cargo test -p paimon-datafusion --lib sql_context::tests::registered_table_function_skips_view_lookup_during_relation_preload -- --exact --nocapture
  • cargo test -p paimon-datafusion --lib rest_catalog_view — 26 passed
  • cargo check -p paimon-datafusion
  • cargo clippy -p paimon-datafusion --lib -- -D warnings
  • cargo fmt --all -- --check

The full paimon-datafusion library test run with fulltext reached 274 passing tests. Seven existing scan tests could not load their expected table fixtures in this local environment.

API and Format

No API or storage format changes.

Documentation

No documentation changes are required.

@jerry-024 jerry-024 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@jerry-024 jerry-024 merged commit 793ab42 into apache:main Jul 13, 2026
12 checks passed
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.

2 participants