Ask Your Question
1

How can I change the values of all fields in lower case?

asked 2020-02-12 23:33:07 -0500

SoftDesire gravatar image

I've a pipeline with 50 columns and I want to change the value of each field in lower case, how can it be achieved in streamset data collector??

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-02-13 09:18:32 -0500

iamontheinet gravatar image

updated 2020-02-13 09:26:01 -0500

Hi!

You can use Field Mapper to apply expressions to field names, values, and/or field paths.

In your case, you can use mapping expression like so ${str:toLower(f:value())} to lower case values of all fields.

image description

Cheers, Dash

edit flag offensive delete link more
0

answered 2020-02-13 00:33:11 -0500

bob gravatar image

Hi. If you're interested in lower-casing the data - I would use a Jython Processor with code like this:

# Sample Jython code 
for record in sdc.records:   
    try:
        for key in record.value.keys():
            record.value[key] = record.value[key].lower()

        # Write record to processor output
        sdc.output.write(record)

  except Exception as e:
       # Send record to error
       sdc.error.write(record, str(e))

-- bob

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-02-12 23:33:07 -0500

Seen: 142 times

Last updated: Feb 13