ydb-platform / ydb-platform/ydb-java-sdk
feat: Support result set size limit for QueryService-based TableClient
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 53
- Forks
- 40
- Avg merge
- 9h 51m
- Merged PRs (30d)
- 7
Description
Currently the QueryService-based TableClient always returns false from DataQueryResult.isTruncated() (https://github.com/ydb-platform/ydb-java-sdk/blob/master/query/src/main/java/tech/ydb/query/impl/TableClientImpl.java#L118).
And to prevent from reading way too much data, the users now have to always remember to set a LIMIT in their queries, which is hard.
I suggest to add an explicit "row limit" setting on TableClient.Builder, which will enforce an application-dependent max ResultSet size => users will get DataQueryResult.isTruncated() == true when that limit is exceeded. Also, with an explicit setting, the QueryService-based TableClient can also stop streaming the result set data as soon as it reaches the limit, preventing resource waste.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in query/src/main/java/tech/ydb/query/impl/TableClientImpl.java at the QueryService-based result handling referenced by the issue, then trace TableClient.Builder and DataQueryResult.isTruncated(). Define how the explicit row limit should affect result truncation and streaming, and verify that results report truncation and stop consuming data once the limit is exceeded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100