Member since
02-23-2018
6
Posts
0
Kudos Received
0
Solutions
02-28-2018
02:14 AM
@Jyoti Ambi Instead of doing all this convertrecord processor choose either of below methods. Method1:- Executesql Processor properties SQL Query:- select MAX(CREATE_DATE) CREATE_DATE from one table Then use ConvertAvrotoJSON processor so we are converting Avro data to json Configs:- Your data would be like this [{"CREATE_DATE": "2018-10-12 09:09:09"}] Then use EvaluateJsonPath Processor to get the create_date value as flowfile content Configs:- Output flowfile content from evaljsonpath processor would be 2018-10-12 09:09:09 Then you can use PutFile processor to store your file into Local directory. Flow:- (or) Method2:- If you want header while keeping file into your directory, then in EvaluateJsonpath processor change the property Destination
flowfile-attribute Then add ReplaceText processor Configs:- Now we are creating new contents of flowfile by keeping header as CREATE_DATE and in new line we are keeping our create_date attribute value (i.e. 2018-10-12 09:09:09) Output:- CREATE_DATE 2018-10-12 09:09:09 Then use PutFile processor to store above file into your local. Flow:- Executesql --> ConvertAvrotoJSON --> EvaluateJSONpath(destination as flowfile attribute) --> Replace text -->putfile
... View more