Skip to content

QL: Add support for unsigned_long field type #63312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
astefan opened this issue Oct 6, 2020 · 3 comments · Fixed by #65145
Closed

QL: Add support for unsigned_long field type #63312

astefan opened this issue Oct 6, 2020 · 3 comments · Fixed by #65145
Assignees
Labels
:Analytics/EQL EQL querying :Analytics/SQL SQL querying >enhancement Team:QL (Deprecated) Meta label for query languages team

Comments

@astefan
Copy link
Contributor

astefan commented Oct 6, 2020

Following #60050 merge, we should consider adding support for it in both EQL and SQL.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (:Query Languages/EQL)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (:Query Languages/SQL)

@elasticmachine elasticmachine added the Team:QL (Deprecated) Meta label for query languages team label Oct 6, 2020
@stu-elastic
Copy link
Contributor

Unsigned long support has been added in #76519 which has been backported to v7.15

You can use doc['ul'].value which will return a java long (which means values greater than 2^63 are negative), or the fields api equivalent field('ul').getValue(default).

You can also treat it as a BigInteger, field('ul').as(Field.BigInteger).getValue(default). For examples, check out the yamlRestTest

bpintea added a commit that referenced this issue Feb 3, 2022
This introduces the UNSIGNED_LONG type to QL following its availability in ES (#60050).

The type is mapped to a BigInteger whose value is checked against the UL bounds.

The SQL will now support the type as literal and in the arithmetic functions; the non-arithmetic functions however are unchanged (i.e. they still require a long / int parameter where that is the case).

The type is version-gated: for the driver SQL clients (only) the server checks their version and in case this is lower than the one introducing the UL support, it fails the request, for queries, or simply hidden in catalog functions (similar to how UNSUPPORTED is currently treated in the similar case)

The JDBC tests are adjusted to read the (bwc) version of the driver they are run against and selectively disable part of the tests accordingly.

Closes #63312
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/EQL EQL querying :Analytics/SQL SQL querying >enhancement Team:QL (Deprecated) Meta label for query languages team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants