aws / aws/amazon-documentdb-jdbc-driver

[BUG] Reverse operators for <, <=, >, >= defined incorrectly

Open
#510 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.