[client] Java table writers do not consistently reject NOT NULL violations
- 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 🐞
Single-table and multi-table Java writers can accept actual null values in top-level NOT NULL columns without rejecting the record before encoding or sending.
For example:
1. Create a destination schema with `payload STRING NOT NULL` and `count INT NOT NULL`.
2. Build a binary row using nullable source types, with null in either field.
3. Pass the row to an append or upsert writer.
On re-encoding paths, a null STRING can become `""`, and a null INT can become `0`. Matching binary formats can bypass re-encoding and forward the invalid row directly. Arrow append also lacks writer-entry NOT NULL validation.
Delete has the same validation gap for primary-key fields: a binary row containing a null key can reach `WriterClient.send` instead of being rejected.
The underlying getters assume NOT NULL fields contain non-null values and may skip null checks. Writers must validate that assumption before invoking getters, routing, or taking binary fast paths.
Expected: reject actual NOT NULL violations before sending, while preserving nullable nulls and allowing unused null placeholders in partial updates and deletes.
### Solution
Share input-value validation across Java single-table and multi-table writers, using `row.isNullAt` before encoding or routing:
- Append/full upsert: validate all NOT NULL columns.
- Partial upsert: validate only selected columns.
- Delete: validate only logical primary-key columns.
Keep existing schema compatibility rules and storage formats unchanged.
### 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 with the Java single-table and multi-table append, upsert, and delete writer entry points, then trace how rows reach WriterClient.send and how row.isNullAt can be used before getters, encoding, or routing. Verify validation for full and partial upserts and logical primary-key deletes, while nullable fields and unused null placeholders remain valid; existing schema compatibility rules and storage formats should be unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100