Member since
07-05-2022
28
Posts
1
Kudos Received
4
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
2482 | 09-19-2022 08:05 AM | |
830 | 09-16-2022 07:02 AM | |
1322 | 09-13-2022 02:22 AM | |
1405 | 09-12-2022 02:58 AM |
09-19-2022
08:05 AM
Hi @SAMSAL, thanks, i have try this out and it works. I thought you can directly edit the value of the JSON file. Now I have to merge all split JSON files into one again
... View more
09-19-2022
06:53 AM
Hi all, I want to add 15 minutes to a date-time value using the transform json processor, but with my configuration I get the same value as before. I expect for the end field to have 15 minutes more than the start field. Does anyone have any idea? [ {
"store_id" : 1001,
"date" : 20220918,
"start" : "2022-09-18 00:15:00",
"end" : "2022-09-18 00:15:00",
"out" : 0
}, {
"store_id" : 1001,
"date" : 20220918,
"start" : "2022-09-18 00:30:00",
"end" : "2022-09-18 00:30:00",
"out" : 0
}] My jolt Specification [
{
"operation": "modify-overwrite-beta",
"spec": {
"*":{
"end": "=${end:toDate('yyyy-MM-dd HH:mm:ss'):toNumber():plus(900000):format('yyyy-MM-dd HH:mm:ss')}"
}
}
}
] The result is the same [ {
"store_id" : 1001,
"date" : 20220918,
"start" : "2022-09-18 00:15:00",
"end" : "2022-09-18 00:15:00",
"out" : 0
}, {
"store_id" : 1001,
"date" : 20220918,
"start" : "2022-09-18 00:30:00",
"end" : "2022-09-18 00:30:00",
"out" : 0
}
... View more
Labels:
- Labels:
-
Apache NiFi
09-16-2022
07:02 AM
I have found a solution. I use in the Query Record Processor the sql function substring and it worked as expected for my case SELECT
SUBSTRING("Interval start", 12, 5) as "start_time"
FROM FLOWFILE store_id date start_time end time out 1005 20220915 00:00 00:15 0
... View more
09-16-2022
06:57 AM
Hey Everyone, i would like insert a string into another string with the query Record Processor with the sql function STUFF but i run into an error. Anyone have an Idea how i can adjust the sql statemant or how i can this string manipulation with the nifi expression language I want to insert a colon in a column with the time of day from that to the 0015 00:15 This is my input Data from an json file [ {
"store_id" : 1011,
"date" : 20220915,
"start_time" : "0015",
"start_end" : "0015",
"out" : 0
}, {
"store_id" : 1011,
"date" : 20220915,
"start_time" : "0030",
"start_end" : "0030",
"out" : 0
}] This is my Sql expression SELECT
"store_id",
"date",
STUFF("start_time",2,0,':') as "start",
"start_end",
"out"
FROM FLOWFILE This is the error message i got QueryRecord[id=46658fcd-0183-1000-0000-000015e8db65] Unable to query StandardFlowFileRecord[uuid=641e1c71-ff9b-45dc-a948-e527eff450f6,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1663335669504-61321, container=default, section=905], offset=280506, length=7780],offset=0,name=aa02839a-3f71-4e8d-860a-9ecee9ba745f,size=7780] due to java.sql.SQLException: Error while preparing statement [SELECT "store_id", "date", STUFF("start_time",2,0,':') as "start", "start_end", "out" FROM FLOWFILE]: org.apache.calcite.sql.validate.SqlValidatorException: No match found for function signature STUFF(, , , ) ↳ causes: org.apache.calcite.runtime.CalciteContextException: From line 4, column 3 to line 4, column 29: No match found for function signature STUFF(, , , ) ↳ causes: java.sql.SQLException: Error while preparing statement [SELECT "store_id", "date", STUFF("start_time",2,0,':') as "start", "start_end", "out" FROM FLOWFILE] ↳ causes: org.apache.nifi.processor.exception.ProcessException: java.sql.SQLException: Error while preparing statement [SELECT "store_id", "date", STUFF("start_time",2,0,':') as "start", "start_end", "out" FROM FLOWFILE] That is the expected output as a csv file store_id date start_time start_end out 1001 20220915 00:15 00:15 0 Thanks for help
... View more
Labels:
- Labels:
-
Apache NiFi
09-15-2022
05:30 AM
Hey everyone, i get a csv file as record from an api call and don't need all columns and want to convert the datetime columns to a time format. For example from 15.09.2022 00:15:00 to 00:15 This is my csv record Interval start Interval stop Camera serial number Counter name Pedestrians coming in Pedestrians going out 15.09.2022 00:00:00 15.09.2022 00:15:00 00000011 11234 0 0 This is my setting in the Query record Processor Query SELECT
#{TodayAxisV2Param} as "date",
"Interval start" as "start time", -- Expected FORMAT(HH:mm)
"Interval stop" as "end time", -- Expected FORMAT(HH:mm)
"Pedestrians going out" as "out"
FROM FLOWFILE I expect this result for the time fields date start time end time out 20220915 00:00 00:15 0 Does anyone have an idea how I can do this with the Query Record Processor?
... View more
Labels:
- Labels:
-
Apache NiFi
09-13-2022
02:22 AM
The Nifi Processor ConvertCharacterSet helps. I use this before the Nifi Processor convert csv to json
... View more
09-13-2022
12:17 AM
Hi everyone, i had a .csv file converted to json with the convert csv to json processor and configured the csv reader. In my csv file i have names with german umlauts. I have use character set UTF 8 or ISO-8859-1 but the output is not the right for german umlauts. the csv file has the following character set from the source system This are my setting of the csv reader controller service Does anyone have an idea for the correct setting. Thanks
... View more
Labels:
- Labels:
-
Apache NiFi
09-12-2022
04:58 AM
Hi Everyone,
i would like to add an attribute to the following json file using the jolt transfomr processor. Unfortunately my json file remains unchanged with the following transformation
Original Json File
{
"logs": [],
"ranges": [
{
"day": "2022-08-31T22:00:00.000Z",
"manager": {
"costByRemunerationId": [],
"total": 0,
"totalHours": 0,
"ancillaryCost": 0
},
"crew": {
"costByRemunerationId": [
{
"remunerationId": "salary",
"remunerationUnit": 2,
"compensation": 76.66666666666667,
"worktimeInH": 0,
"durationInDays": 0,
"quantity": 0,
"ancillaryCost": 15.854666666666667
}
],
"total": 76.66666666666667,
"totalHours": 0,
"ancillaryCost": 15.854666666666667
},
"trainee": {
"costByRemunerationId": [],
"total": 0,
"totalHours": 0,
"ancillaryCost": 0
},
"apprentice": {
"costByRemunerationId": [],
"total": 0,
"totalHours": 0,
"ancillaryCost": 0
},
"total": 76.66666666666667,
"totalHours": 0,
"ancillaryCost": 15.854666666666667
},
{
"day": "2022-09-01T22:00:00.000Z",
"manager": {
"costByRemunerationId": [],
"total": 0,
"totalHours": 0,
"ancillaryCost": 0
},
"crew": {
"costByRemunerationId": [
{
"remunerationId": "normalHours",
"remunerationUnit": 0,
"compensation": 0,
"worktimeInH": 7.8329297222222225,
"durationInDays": 2,
"quantity": 0,
"ancillaryCost": 0
},
{
"remunerationId": "salary",
"remunerationUnit": 2,
"compensation": 76.66666666666667,
"worktimeInH": 0,
"durationInDays": 0,
"quantity": 0,
"ancillaryCost": 15.854666666666667
}
],
"total": 76.66666666666667,
"totalHours": 7.8329297222222225,
"ancillaryCost": 15.854666666666667
},
"trainee": {
"costByRemunerationId": [],
"total": 0,
"totalHours": 0,
"ancillaryCost": 0
},
"apprentice": {
"costByRemunerationId": [],
"total": 0,
"totalHours": 0,
"ancillaryCost": 0
},
"total": 76.66666666666667,
"totalHours": 7.8329297222222225,
"ancillaryCost": 15.854666666666667
}
]
}
Jolt Transform
[
{
"operation": "modify-default-beta",
"spec": {
"*": {
"target.organisation": "${target.organisation}"
}
}
}
]
Expected result
{ "logs": [], "ranges": [ { "day": "2022-08-31T22:00:00.000Z", "manager": { "costByRemunerationId": [], "total": 0, "totalHours": 0, "ancillaryCost": 0 }, "crew": { "costByRemunerationId": [ { "remunerationId": "salary", "remunerationUnit": 2, "compensation": 76.66666666666667, "worktimeInH": 0, "durationInDays": 0, "quantity": 0, "ancillaryCost": 15.854666666666667 } ], "total": 76.66666666666667, "totalHours": 0, "ancillaryCost": 15.854666666666667 }, "trainee": { "costByRemunerationId": [], "total": 0, "totalHours": 0, "ancillaryCost": 0 }, "apprentice": { "costByRemunerationId": [], "total": 0, "totalHours": 0, "ancillaryCost": 0 }, "total": 76.66666666666667, "totalHours": 0, "ancillaryCost": 15.854666666666667 }, { "day": "2022-09-01T22:00:00.000Z", "manager": { "costByRemunerationId": [], "total": 0, "totalHours": 0, "ancillaryCost": 0 }, "crew": { "costByRemunerationId": [ { "remunerationId": "normalHours", "remunerationUnit": 0, "compensation": 0, "worktimeInH": 7.8329297222222225, "durationInDays": 2, "quantity": 0, "ancillaryCost": 0 }, { "remunerationId": "salary", "remunerationUnit": 2, "compensation": 76.66666666666667, "worktimeInH": 0, "durationInDays": 0, "quantity": 0, "ancillaryCost": 15.854666666666667 } ], "total": 76.66666666666667, "totalHours": 7.8329297222222225, "ancillaryCost": 15.854666666666667 }, "trainee": { "costByRemunerationId": [], "total": 0, "totalHours": 0, "ancillaryCost": 0 }, "apprentice": { "costByRemunerationId": [], "total": 0, "totalHours": 0, "ancillaryCost": 0 }, "total": 76.66666666666667, "totalHours": 7.8329297222222225, "ancillaryCost": 15.854666666666667 } ],
"target.organisation": myorganisation }
Thanks for idea what is still missing from my query
... View more
Labels:
- Labels:
-
Apache NiFi
09-12-2022
02:58 AM
I have found the solution, for the changing parts of the url https://mycompany\.my\.app/api/public/v1/organisations/([0-9a-z]+)/detailedLaborcosts.*
... View more
09-12-2022
12:42 AM
Hi, thanks for your help. Unfortunately it does not work, here is the entire URL I have also defined variables that are part of the URL. I had not considered that these must be taken into account https://mycompany.my.app/api/public/v1/organisations/60910c2f18572ebe8aa7a677/detailedLaborcosts?month=#{today}&apiKey=myapikey The components highlighted in red may change, the rest is constant
... View more
- « Previous
-
- 1
- 2
- Next »