Skip to content

[lake] Optimize TableLookup finder creation#2554

Open
KiteSoar wants to merge 2 commits intoapache:mainfrom
KiteSoar:optimize_lookup
Open

[lake] Optimize TableLookup finder creation#2554
KiteSoar wants to merge 2 commits intoapache:mainfrom
KiteSoar:optimize_lookup

Conversation

@KiteSoar
Copy link

@KiteSoar KiteSoar commented Feb 2, 2026

Purpose

Linked issue: close #2521

Brief change log

  • Enhance TableLookup.createLookuper() to intelligently route lookup requests:
    • Create PrimaryKeyLookuper when lookup columns match primary key
    • Create PrefixKeyLookuper when lookup columns are valid prefix key
    • Fail-fast with clear error message for invalid lookup columns

Tests

  • Add TableLookupTest with 10 test cases covering:
    • Primary key lookup (with/without lookupBy, partitioned/non-partitioned)
    • Prefix key lookup (single/multiple columns, partitioned/non-partitioned)
    • Invalid inputs (out-of-order, empty, non-primary/non-prefix columns)
    • Log table rejection

API and Format

None

Documentation

None

@KiteSoar KiteSoar force-pushed the optimize_lookup branch 5 times, most recently from de87a73 to 78502d9 Compare February 3, 2026 13:57
@KiteSoar
Copy link
Author

KiteSoar commented Feb 4, 2026

Hi @luoyuxia Could you please help review when you got some time?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Optimizes TableLookup.createLookuper() to choose between primary-key and prefix-key lookup based on provided lookup columns, and adds tests to validate the routing and failure behavior (linked to #2521).

Changes:

  • Update TableLookup.createLookuper() to route to PrimaryKeyLookuper for full-PK lookups and PrefixKeyLookuper for prefix-key lookups, otherwise throw an error.
  • Add TableLookupTest covering primary-key routing, prefix-key routing, and invalid input cases.
  • Adjust FlussLakeTableITCase to consistently use lookupBy(...) when creating lookupers.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
fluss-client/src/main/java/org/apache/fluss/client/lookup/TableLookup.java Adds routing logic and validation/error path for lookuper creation based on lookup columns.
fluss-client/src/test/java/org/apache/fluss/client/lookup/TableLookupTest.java New unit tests validating routing and invalid-argument behavior.
fluss-client/src/test/java/org/apache/fluss/client/table/FlussLakeTableITCase.java Updates integration test to always specify lookup columns via lookupBy(...).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

lookupBy should align with the method name to support do primary key lookup

1 participant