Field merger for LIST_MAP and MAP

asked 2018-10-25 13:57:43 -0600

I have a problem with following stages:

... -> Expression evaluator -> Field Merger -> ...

Expression evaluator config:

Output field: /current_document

Field expression: ${record:value('/current_document/data[0]')!=NULL?record:value('/current_document/data[0]'):emptyMap()}

For some reason /current_document has type LIST_MAP on processor output, though elements of /current_document/data array have type MAP. It wouldn't be a problem if next processor could merge LIST_MAP and MAP types.

Field merger config:

From field: /current_document

To field: /data/document

At this stage I receive error:

FIELD_MERGER_02 - Cannot merge field of type `LIST_MAP` with field of type `MAP`

I would like to solve this problem via standard processors, but don't see options.
1. No way to convert LIST_MAP to MAP.
2. No way to get MAP instead of LIST_MAP in Expression evaluator stage
3. No way to merge MAP with LIST_MAP in Field merger processor

There is probably solution via custom processor or jython/similar one, but it looks like workaround

edit retag flag offensive close merge delete