Repository navigation
Conversation
Bind the client's Lookuper and PrefixKeyLookuper so Elixir can read
rows from primary key (KV) tables.
- Introduce `Fluss.Lookuper` and `Fluss.PrefixLookuper`
- Fluss.Lookuper: lookup/2 by primary key (list or map), returning
{:ok, row} or {:ok, nil}; lookup!/2 raises Fluss.NoResultsError.
- Fluss.PrefixLookuper: lookup/2 returns every row with a bucket-key
prefix.
- Allow configuring the five lookup.* config keys on Fluss.Config.
- Add integration tests for both lookups, key validation, composite keys,
partitioned tables and concurrent use.
|
|
||
| # Hangs: core retries an unknown bucket leader forever instead of failing. | ||
| @tag :skip | ||
| test "returns an error after the table is dropped", %{conn: conn, admin: admin} do |
There was a problem hiding this comment.
@fresh-borzoni: while testing this, it seems that lookups on a dropped table never return, because they are re-enqueued without counting retries (seems like a gap in LookupDispatcher, but I am not too familiar with the code to be 100% sure). I'd expect to get table_not_exist, but the test actually times out, that is why it is skipped for now. I'll remove the tag once the issue is addressed one way or another.
There was a problem hiding this comment.
@nicolazar Good catch, It's a real gap, but not Elixir-specific and not new: the Java client does the same.
Both clients re-queue a lookup whose leader can't be found, without counting retries. Java only fails fast for a dropped partition.
Keeping the test skipped here is fine. Could you file an issue and link it in the skip comment(TODO or smth)?
Purpose
Linked issue: close apache/fluss-rust#462
This PR adds primary key lookups to the Elixir bindings, completing the primary key table support alongside #4628.
Brief change log
Allow Elixir clients to read rows from primary key (KV) tables:
Fluss.LookuperandFluss.PrefixLookuper, the interfaces for KV table lookupsFluss.Lookuper:lookup/2by primary key (list or map), returning{:ok, row}or{:ok, nil}; its bang variant raisesFluss.NoResultsError, similar toEcto.NoResultsError.Fluss.PrefixLookuper:lookup/2returns every row matching the bucket-key prefix.lookup.*config keys onFluss.Config, as in the python bindings.Tests
Integration tests in
test/integration/lookup_test.exs, on a real cluster:lookup!/2, null columnsAPI and Format
New public Elixir API only. No storage format change.