Skip to content

[Transform] Transform fails for unsigned long fields #63871

Closed
@hendrikmuhs

Description

@hendrikmuhs

#60050 introduced a new field type unsigned_long. Transform fails in certain combinations if the source index uses a field mapped to unsigned_long.

Repro steps:

PUT test_ul
{
  "mappings": {
    "properties": {
      "metric": {
        "type": "unsigned_long"
      },
      "id": {
        "type": "keyword"
      }
    }
  }
}

POST test_ul/_doc/1
{
  "id": "a",
  "metric": 3333
}

POST test_ul/_doc/2
{
  "id": "b",
  "metric": 3352
}

POST test_ul/_doc/3
{
  "id": "c",
  "metric": 1222
}

POST test_ul/_doc/4
{
  "id": "d",
  "metric": 4452345
}

PUT _transform/ul1
{
  "source": {
    "index": "test_ul"
  },
  "dest": {
    "index": "ul1"
  }, 
  "pivot": {
    "group_by": {
      "id": {
        "terms": {
          "field": "id"
        }
      }
    },
    "aggregations": {
      "m": {
        "max": {
          "field": "metric"
        }
      },
      "a": {
        "avg": {
          "field": "metric"
        }
      }
    }
  }
}

POST _transform/ul1/_start
GET _transform/ul1/_stats

failure:

"reason" : "Failed to index documents into destination index due to permanent error: [org.elasticsearch.xpack.transform.transforms.BulkIndexingException: Bulk index experienced [4] failures and at least 1 irrecoverable [org.elasticsearch.xpack.transform.transforms.TransformException: Destination index mappings are incompatible with the transform configuration.; org.elasticsearch.index.mapper.MapperParsingException: failed to parse field [m] of type [unsigned_long] in document with id 'YWq29udX231QplrSgrzYJUMAAAAAAAAA'. Preview of field's value: '3333.0'; java.lang.IllegalArgumentException: For input string: [3333.0].]. Other failures:; org.elasticsearch.xpack.transform.transforms.TransformException: Destination index mappings are incompatible with the transform configuration.; org.elasticsearch.index.mapper.MapperParsingException: failed to parse field [m] of type [unsigned_long] in document with id 'YWq29udX231QplrSgrzYJUMAAAAAAAAA'. Preview of field's value: '3333.0'; java.lang.IllegalArgumentException: For input string: [3333.0].]",

Root cause: Transform indexes the output as string as it does not know that unsigned_long is a numeric type, which is due to the addition of unsigned_long as plugin.

Non-Issue: Because unsigned_long support has not been released yet, this issue is not a bug by definition. It's still important to fix.

Blocker: In order to not become a bug, I classify it as blocker.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions