Skip to content

ES|QL: JOIN left field is incompatible with right field of type #126419

@luigidellaquila

Description

@luigidellaquila

On CSV dataset

from sample_data_t*,client_cidr,languag*
| rename language.name.keyword as message 
| lookup join message_types_lookup on message 
| drop language_code, language.code, @timestamp, country.keyword, `client_ip`, event_duration, *r, language_name, `env`, *v, `client_cidr`, `@timestamp` 
| rename message as message 
| lookup join message_types_lookup on message 
| eval  yjFBNROMv = 4066967889218962785, `message` = true, language.name = "a", language.id = null, `language.name` = 1, type = 1, yHfbOTMUV = "a", `type` = null 
| rename country AS language.name  
| enrich languages_policy on yHfbOTMUV
| rename language_name as message 
| lookup join message_types_lookup on message
| rename type as message 
| lookup join message_types_lookup on message 
| keep `language.name`, lang*, language.name, yHfbOTMUV, `language.id`

The query works fine until you add last KEEP, then it starts failing

{
    "error": {
        "root_cause": [
            {
                "type": "verification_exception",
                "reason": "Found 1 problem\nline 1:733: JOIN left field [message] of type [NULL] is incompatible with right field [message] of type [KEYWORD]"
            }
        ],
        "type": "verification_exception",
        "reason": "Found 1 problem\nline 1:733: JOIN left field [message] of type [NULL] is incompatible with right field [message] of type [KEYWORD]"
    },
    "status": 400
}

The query was generated by GenerativeIT tests, it can probably be simplified a lot

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions