-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Closed
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL:StorageEngine/MappingThe storage related side of mappingsThe storage related side of mappings>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)Team:StorageEngine
Description
In ESQL different results are returned when using scaled_float field depending if the field has doc values enabled.
Steps to reproduce:
PUT my-index
{
"mappings": {
"properties": {
"sf": {
"type": "scaled_float",
"scaling_factor": 10
}
}
}
}
PUT my-index/_doc/1?refresh
{
"sf": 0.3
}
POST /_query?format=txt
{
"query": "FROM my-index"
}
// results in
sf
-------------------
0.30000000000000004
DELETE my-index
PUT my-index
{
"mappings": {
"properties": {
"sf": {
"type": "scaled_float",
"doc_values": false,
"scaling_factor": 10
}
}
}
}
PUT my-index/_doc/1?refresh
{
"sf": 0.3
}
POST /_query?format=txt
{
"query": "FROM my-index"
}
// results in
sf
---------------
0.3
This is because of the difference in transforming a rounded long value to a double
https://github.com/elastic/elasticsearch/blob/main/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java#L315
https://github.com/elastic/elasticsearch/blob/main/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java#L389
Metadata
Metadata
Assignees
Labels
:Analytics/ES|QLAKA ESQLAKA ESQL:StorageEngine/MappingThe storage related side of mappingsThe storage related side of mappings>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)Team:StorageEngine