Skip to content

ESQL: unmapped_fields="load" loads as null in case of union types #142004

@alex-spies

Description

@alex-spies

Relates #138888

curl -u elastic:password -H "Content-Type: application/json" "127.0.0.1:9200/test" -XPUT -d '{
  "mappings": { "dynamic": false,
    "properties": { "foo": {"type": "long"}, "bar": {"type": "integer"}                    
    }              
  }
}'

curl -u elastic:password -H "Content-Type: application/json" "127.0.0.1:9200/test2" -XPUT -d '{
  "mappings": { "dynamic": false,
    "properties": { "bar": {"type": "integer"}                         
    }              
  }
}'

curl -u elastic:password -H "Content-Type: application/json" "127.0.0.1:9200/test3" -XPUT -d '{
  "mappings": { "dynamic": false,
    "properties": { "foo": {"type": "integer"}, "bar": {"type": "integer"}             
    }              
  }
}'

curl -u elastic:password -HContent-Type:application/json 'localhost:9200/test/_doc?refresh' -d'{"foo": 5, "bar": 10}' 

curl -u elastic:password -HContent-Type:application/json 'localhost:9200/test2/_doc?refresh' -d'{"foo": 10, "bar": 10}'

curl -u elastic:password -HContent-Type:application/json 'localhost:9200/test3/_doc?refresh' -d'{"foo": 10, "bar": 10}'

curl -u elastic:password -H "Content-Type: application/json" "127.0.0.1:9200/_query?format=txt" -d '
{
  "query": "SET unmapped_fields=\"load\"; FROM test, test2, test3 | KEEP foo | eval foo = foo::integer"}' 
      foo      
---------------
null           
5              
10   

Metadata

Metadata

Assignees

No one assigned

    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