aws / aws/amazon-documentdb-jdbc-driver
[BUG] Reverse operators for <, <=, >, >= defined incorrectly
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
The REVERSE_OPERATORS in DocumentDbRules are defined in a way that returns unexpected results.
Ex. For a column val [1, 2, 3] `select val from int_table where 2 >= val` should return `[1, 2]`
Currently, the driver reverses the operator >= to be '$lt' which is the same as `select val from int_table where val < 2` which returns `[1]`
The correct reverse operator is '$lte' which should return `[1, 2]`.
This should be a very quick fix, I made the change locally myself and it looks like this: [Reverse Operator Change](https://github.com/aws/amazon-documentdb-jdbc-driver/compare/develop...sophia-bq:amazon-documentdb-jdbc-driver:develop)
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
Inspect the Java class DocumentDbRules and its REVERSE_OPERATORS definition first. Reproduce the supplied int_table comparison and verify that the corrected reverse mapping makes `2 >= val` return `[1, 2]` rather than `[1]`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- database
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100