apache / apache/gravitino

[Improvement] Lance partition statistics drop API reports success even when nothing is deleted

Open
#10,620 1 comment 0 reactions 1 assignee Claimed by @yunhwane View on GitHub
good first issue improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 16h
Merged PRs (30d)
298

Description

### What would you like to be improved?

When Gravitino is configured to use org.apache.gravitino.stats.storage.LancePartitionStatisticStorageFactory for partition statistics storage, dropping partition statistics can return success even if no statistics were actually removed.

In LancePartitionStatisticStorage.java, dropStatistics(...) always returns 1 as a placeholder:

That value is later converted to a boolean in StatisticManager.java, where != 0 becomes true, and the REST API returns DropResponse(true).

This means clients can get a successful drop result even when:
- the target partition does not exist
- the statistic name does not exist
- nothing was actually deleted

### How should we improve?

Do not return a hard-coded success count from the Lance backend.

Possible fixes:
- Change the Lance dropStatistics(...) contract so it returns an accurate deleted count.
- If Lance cannot provide counts, change the higher-level API to avoid interpreting a placeholder count as success.
- As a safe short-term fix, have the Lance path return 0 only when the request is empty and otherwise explicitly verify whether matching rows existed before deletion, then return a real count or a trustworthy boolean.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.