Skip to content

Unsigned long should accept value with zero fraction#75646

Merged
dnhatn merged 7 commits intoelastic:masterfrom
dnhatn:parse-unsigned-long
Jul 30, 2021
Merged

Unsigned long should accept value with zero fraction#75646
dnhatn merged 7 commits intoelastic:masterfrom
dnhatn:parse-unsigned-long

Conversation

@dnhatn
Copy link
Copy Markdown
Member

@dnhatn dnhatn commented Jul 22, 2021

Closes #67565

@dnhatn dnhatn added >enhancement :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.15.0 labels Jul 22, 2021
@dnhatn dnhatn requested a review from mayya-sharipova July 22, 2021 18:44
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jul 22, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search (Team:Search)

Copy link
Copy Markdown
Contributor

@mayya-sharipova mayya-sharipova left a comment

Choose a reason for hiding this comment

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

@dnhatn Thanks for this fix, and sorry for a late reply. The change and the tests overall look great to me, but we should also address a case where a zero decimal comes in a numeric form, as current the following test will fail:

ParsedDocument doc = mapper.parse(source(b -> b.field("field", 100.0)));
assertThat(doc.rootDoc().getFields("field")[0].numericValue().longValue(), equalTo(Long.MIN_VALUE + 100L));

@dnhatn
Copy link
Copy Markdown
Member Author

dnhatn commented Jul 29, 2021

Thanks Mayya! I pushed fdf023b.

@dnhatn dnhatn requested a review from mayya-sharipova July 29, 2021 15:39
@dnhatn
Copy link
Copy Markdown
Member Author

dnhatn commented Jul 29, 2021

@elasticmachine update branch

Copy link
Copy Markdown
Contributor

@mayya-sharipova mayya-sharipova left a comment

Choose a reason for hiding this comment

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

Thanks Nhat, this LGTM

@dnhatn
Copy link
Copy Markdown
Member Author

dnhatn commented Jul 30, 2021

@mayya-sharipova Thanks for reviews.

@dnhatn dnhatn added the auto-backport Automatically create backport pull requests when merged label Jul 30, 2021
@dnhatn dnhatn merged commit 8b9b8a9 into elastic:master Jul 30, 2021
@dnhatn dnhatn deleted the parse-unsigned-long branch July 30, 2021 12:30
@dnhatn dnhatn changed the title Unsigned long should accept value with zero decimal Unsigned long should accept value with zero fraction Jul 30, 2021
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

💚 Backport successful

Status Branch Result
7.x

elasticsearchmachine pushed a commit to elasticsearchmachine/elasticsearch that referenced this pull request Jul 30, 2021
elasticsearchmachine added a commit that referenced this pull request Jun 28, 2022
Closes #67565

Co-authored-by: Nhat Nguyen <nhat.nguyen@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >enhancement :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v7.15.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unsigned long field mapping behaviour is inconsistent with other numeric fields

5 participants