Skip to content

Commit 5beaaea

Browse files
authored
fix some docs of prefix lookup api (#1447)
1 parent a71a337 commit 5beaaea

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

fluss-client/src/main/java/com/alibaba/fluss/client/lookup/Lookuper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public interface Lookuper {
3434
* Lookups certain row from the given lookup key.
3535
*
3636
* <p>The lookup key must be a primary key if the lookuper is a Primary Key Lookuper (created by
37-
* {@code table.newLookuper().create()}), or be the prefix key if the lookuper is a Prefix Key
38-
* Lookuper (created by {@code table.newLookuper().withLookupColumns(prefixKeys).create()}).
37+
* {@code table.newLookup().createLookuper()}), or be the prefix key if the lookuper is a Prefix
38+
* Key Lookuper (created by {@code table.newLookup().lookupBy(prefixKeys).createLookuper()}).
3939
*
4040
* @param lookupKey the lookup key.
4141
* @return the result of lookup.

website/docs/apis/java-client.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,17 @@ while (true) {
249249
```
250250

251251
### Lookup
252-
You can also use the Fluss API to perform lookups on a table. This is useful for querying specific records based on their primary key.
252+
You can also use the Fluss API to perform lookups on a table. This is useful for querying specific records based on their primary key or prefix key.
253253
```java
254-
LookupResult lookup = table.newLookup().createLookuper().lookup(rowKey).get();
254+
// Lookup by primary key
255+
LookupResult lookup = table.newLookup()
256+
.createLookuper()
257+
.lookup(rowKey)
258+
.get();
259+
// Lookup by prefix key
260+
LookupResult prefixLookup = table.newLookup()
261+
.lookupBy(prefixKeys)
262+
.createLookuper()
263+
.lookup(rowKey)
264+
.get();
255265
```

0 commit comments

Comments
 (0)