apache / apache/fluss

[client] Typed deletes drop partition keys on partitioned primary-key tables

Open
#4,303 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.1k
Forks
625
Avg merge
3d 14h
Merged PRs (30d)
97

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/fluss/issues) and found nothing similar.

### Fluss version

main (development)

### Please describe the bug 🐞

`TypedUpsertWriter.delete(pojo)` fails on a partitioned primary-key table even when the POJO contains all primary-key and partition values.

Example:

```text
Columns: id INT, dt STRING, payload STRING
PRIMARY KEY: (id, dt)
PARTITION BY: dt
Delete input: {id: 42, dt: "2026-09-11", payload: null}
```

Expected: route the delete to partition `2026-09-11` for physical key `id=42`.

Actual: the POJO is converted to `[42, null, null]`, and partition resolution throws `NullPointerException: Partition value shouldn't be null.` before sending the delete.

`TypedUpsertWriterImpl` uses physical primary keys for both projection and row expansion. Physical primary keys exclude partition columns, so `dt` is lost.

### Solution

Use logical primary keys for the typed delete projection and row expansion, preserving partition values for routing.

### Are you willing to submit a PR?

- [x] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in TypedUpsertWriterImpl and trace how typed deletes project and expand rows before partition resolution. Reproduce the partitioned primary-key example from the issue; done means the delete preserves dt for routing while using id as the physical key and no longer raises a null partition-value error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.