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

ESQL: unexpected verification_exception for same field name in two indices (union types) #111452

Closed
astefan opened this issue Jul 30, 2024 · 3 comments · Fixed by #111475
Closed
Assignees
Labels
:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@astefan
Copy link
Contributor

astefan commented Jul 30, 2024

Description

test1 index

{
    "mappings": {
        "properties": {
            "x": {
                "type": "keyword"
            }
        }
    }
}

test2 index

{
    "mappings": {
        "properties": {
            "x": {
                "type": "long"
            },
            "whatever": {
                "type": "text"
            }
        }
    }
}

from test* | rename whatever as foo results in

     "type": "verification_exception",
        "reason": "Found 1 problem\nline 1:1: Cannot use field [x] due to ambiguities being mapped as [2] incompatible types: [keyword] in [test1], [long] in [test2]",
        "stack_trace": "org.elasticsearch.xpack.esql.VerificationException: Found 1 problem\nline 1:1: Cannot use field [x] due to ambiguities being mapped as [2] incompatible types: [keyword] in [test1], [long] in [test2]
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jul 30, 2024
@alex-spies alex-spies changed the title ESQL: unexpected verification_exception for same field name in two indices ESQL: unexpected verification_exception for same field name in two indices (union types) Jul 30, 2024
@alex-spies
Copy link
Contributor

I can confirm that the given query used to work on 8.14, but breaks on current main and on 8.15.

@alex-spies
Copy link
Contributor

There's a workaround: you can just DROP the offending field before the RENAME.

from test* | drop x | rename whatever as foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants