Ask Your Question
1

How can I convert an existing record's root field to MAP?

asked 2018-02-13 15:48:31 -0500

jeff gravatar image

I have a record whose root field is of some scalar type (say, for example STRING or BYTE_ARRAY). How can I convert the root type to a MAP so that subfields can be added, while preserving the previous root field value (ex: as /original)?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-02-14 08:09:12 -0500

tmcgrath gravatar image

I'm curious about this too. How about trying an Expression Evaluator with the emptyMap function to the / output field as shown in this screenshot?

image description

or

${record:value('/')} for / Output Field

edit flag offensive delete link more

Comments

Thanks, your suggestion of setting output field of / with ${emptyMap()} was exactly what I needed. The key in my case was to also capture the original root in an attribute so that I can then restore it afterward (after the root is set to map). That was done in another expression processor before.

jeff gravatar imagejeff ( 2018-02-14 22:05:09 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-02-13 15:48:31 -0500

Seen: 58 times

Last updated: Feb 14