Skip to content
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

Unsigned long field mapping behaviour is inconsistent with other numeric fields #67565

Closed
stevejgordon opened this issue Jan 15, 2021 · 3 comments · Fixed by #75646
Closed

Unsigned long field mapping behaviour is inconsistent with other numeric fields #67565

stevejgordon opened this issue Jan 15, 2021 · 3 comments · Fixed by #75646
Assignees
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@stevejgordon
Copy link
Contributor

Elasticsearch version: 7.11.0
Plugins installed: []
JVM version: n/a
OS version: n/a

Description of the problem including expected versus actual behavior:
There is a discrepancy for unsigned_long vs. other numeric fields when providing a null_value in the mapping. Currently, integer for example, accepts a null_value of 1.0 which is checked for empty fractal parts. It will correctly reject a null value of 1.5. unsigned_long mappings return a "mapper_parsing_exception" when 1.0 is specified.

Ideally, the unsigned_long field should behave in the same way as other numeric fields and check for empty fractal parts.

Steps to reproduce:

  1. Attempt to create an index with the following mapping
PUT my_index
{
  "mappings": {
    "properties": {
      "my_counter": {
        "type": "unsigned_long",
        "null_value": 1.0
      },
      "my_int": {
        "type": "integer",
        "null_value": 1.0
      },
      "my_short": {
        "type": "short",
        "null_value": 1.0
      }
    }
  }
}
  1. Only the my_counter field causes a "mapper_parsing_exception".
@stevejgordon stevejgordon added >bug needs:triage Requires assignment of a team area label labels Jan 15, 2021
@romseygeek romseygeek added the :Search Foundations/Mapping Index mappings, including merging and defining field types label Jan 15, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jan 15, 2021
@elasticmachine
Copy link
Collaborator

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

@romseygeek romseygeek removed Team:Search Meta label for search team needs:triage Requires assignment of a team area label labels Jan 15, 2021
@romseygeek
Copy link
Contributor

cc @mayya-sharipova

@mayya-sharipova
Copy link
Contributor

@stevejgordon Thank you for filling this issue. This was a design decision NOT to accept numbers with floating points, as we were considering to disable coercion altogether. But as we postponed disabling of coercion, I think it make sense for now to make unsigned_long consistent with other types and accept at least floating point numbers ending with .0

@dnhatn dnhatn self-assigned this Jul 22, 2021
elasticsearchmachine pushed a commit to elasticsearchmachine/elasticsearch that referenced this issue Jul 30, 2021
elasticsearchmachine added a commit that referenced this issue Jun 28, 2022
Closes #67565

Co-authored-by: Nhat Nguyen <nhat.nguyen@elastic.co>
@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants