opensearch-project / opensearch-project/sql
[BUG] `LIMIT` works incorrectly with `NESTED`
@forestmvey is already working on this.
Since Jun 22, 2023.
- Dominant language
- Java
- Stars
- 176
- Forks
- 229
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
What is the bug?
https://github.com/Bit-Quill/opensearch-project-sql/pull/278#issuecomment-1599332365
A query with LIMIT N and NESTED function may return M rows, where M > N.
How can one reproduce the bug?
https://github.com/Bit-Quill/opensearch-project-sql/pull/278#issuecomment-1599332365
Being pushed down LIMIT defines number of docs to be returned, but NestedOperator adds extra rows while processes cartesian products.
What is the expected behavior?
Keep LIMIT pushed down, but leave LogicalLimit/LimitOperator in the plan tree to count number of the rows returned and cut off when limit reached.
Depends on Optimizer rework presented in #1752.
What is your host/environment?
main @ ded014d1
Do you have any screenshots?
N/A
Do you have any additional context?
N/A
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.
Assessment
This issue has not been assessed yet.