Skip to content

ESQL: unmapped_fields="load" can lead to wrong sort order #141925

@alex-spies

Description

@alex-spies

To reproduce, unmap the name from the apps index in mapping-apps.json:

{
    "dynamic": false,
    "properties" : {
        "id" : {
            "type" : "integer"
        },
        "version" : {
            "type" : "version"
        }
    }
}

Then, run the test query

implictCastingNotEqual
required_capability: string_literal_auto_casting_extended
from apps | where version != "1.2.3.4" | sort name, version | keep name, version | limit 2;

via

./gradlew ":x-pack:plugin:esql:qa:server:single-node:javaRestTest" --tests "org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT" -Dtests.method="test {csv-spec:version.ImplictCastingNotEqual}"

Data mismatch:
row 1 column 0:a list containing
row 1 column 0:0: expected "bbbbb" but was "eeeee"
row 1 column 1:a list containing
row 1 column 1:0: expected "2.1" but was "1.11.0"
Actual:
name:keyword | version:version
aaaaa        | 1
eeeee        | 1.11.0

Expected:
name:keyword | version:version
aaaaa        | 1
bbbbb        | 2.1

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions