Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

ReplaceText Processor

Solved Go to solution

ReplaceText Processor

Explorer

Hello!
Can't understand whats wrong...
I've got processors group to take data from json to sql.

When I try to "view as formatted" - I see this:

Use SplitJson to split file after it use ReplaceText... and he doesn't work correctly. Unable to generate view of data: Unrecognized token 'INSERT': was expecting 'null', 'true', 'false' or NaN at [Source: (BufferedInputStream); line: 1, column: 8"

77830-replacetext-processor.jpg

77834-after-replacetext.jpg

77832-after-splitjson.jpg

77831-replacement-value.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: ReplaceText Processor

Super Guru
@Vladislav Shcherbakov

Before ReplaceText processor use EvaluateJsonPath processor to extract the json values, keep as flowfile attributes.

77837-evaluatejsonpath.png

Add all your properties(case sensitive) in this processor and keep the destination as flowfile-attribute then feed the success relationship from EvaluateJsonpath to Replace text processor.

Flow:

---
--- other processors 3.SplitJson
5.EvaluateJsonPath 6.ReplaceText

View solution in original post

1 REPLY 1
Highlighted

Re: ReplaceText Processor

Super Guru
@Vladislav Shcherbakov

Before ReplaceText processor use EvaluateJsonPath processor to extract the json values, keep as flowfile attributes.

77837-evaluatejsonpath.png

Add all your properties(case sensitive) in this processor and keep the destination as flowfile-attribute then feed the success relationship from EvaluateJsonpath to Replace text processor.

Flow:

---
--- other processors 3.SplitJson
5.EvaluateJsonPath 6.ReplaceText

View solution in original post

Don't have an account?
Coming from Hortonworks? Activate your account here