Skip to content

Conversation

@luigidellaquila
Copy link
Contributor

@luigidellaquila luigidellaquila commented Sep 5, 2022

Fixes #83516

H2 is not as precise as Elasticsearch at calculating division and modulo operations on big numbers (numbers that exceed Long.MAX_VALUE). This leads to sporadic failures on sql-spec tests.

As stated in the issue (and verified with further analysis), all the failure logs report an incorrect expected value (calculated by H2), while the value returned by Elasticsearch proved to be correct.

This PR removes these tests from sql-spec. These cases are covered in csv-spec anyway.

Also adding some further csv-spec tests on division (eg. unsigned long divided by floating point) for a complete coverage.

@luigidellaquila luigidellaquila marked this pull request as ready for review September 5, 2022 12:02
@luigidellaquila luigidellaquila added >test Issues or PRs that are addressing/adding tests :Analytics/SQL SQL querying labels Sep 5, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

Copy link
Contributor

@Luegg Luegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
I wonder if our tests have enough casting/downcasting and how corner cases are handled:
E.g.CAST(18446744073709551614/7306) AS UNSIGNED LONG, etc...

@luigidellaquila luigidellaquila merged commit 0b8ba2a into elastic:main Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/SQL SQL querying Team:QL (Deprecated) Meta label for query languages team >test Issues or PRs that are addressing/adding tests v8.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] JdbcSqlSpecIT » test {unsigned-long.testMod}

6 participants