Skip to content

Fix#8033 Database Join add load SQL from a file - #8064

Open
leehaut wants to merge 1 commit into
apache:mainfrom
leehaut:hotfix/lance-common-8
Open

Fix#8033 Database Join add load SQL from a file#8064
leehaut wants to merge 1 commit into
apache:mainfrom
leehaut:hotfix/lance-common-8

Conversation

@leehaut

@leehaut leehaut commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Fix #8033

Summary

Adds Load SQL from file to the Database Join transform, matching Table Input.

A Database Join can now point at an external .sql file (VFS path, variables such as ${PROJECT_HOME}/sql/lookup_records.sql). The query is read once at transform init. ? placeholders still bind to the Parameters table, so the same lookup SQL can be reused across pipelines without copy-paste.

Leaving the path empty keeps the previous inline SQL editor (backward compatible).

Changed

  • Runtime: sql_from_file on DatabaseJoinMeta; getEffectiveSql() loads the file via VFS (UTF-8). DatabaseJoin.init() prepares that SQL, then applies Replace variables when enabled.
  • UI: path + Browse above the SQL editor. When a file is set, the editor is a read-only preview; clearing the path makes it editable again.
  • Docs / i18n: user manual (databasejoin.adoc) and en_US / zh_CN messages.
  • Add integration test 0009-database-join-sql-file.hpl

Signed-off-by: lance <leehaut@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Load SQL from file to Database Join

1 participant