Member since
11-07-2017
12
Posts
4
Kudos Received
0
Solutions
01-25-2018
04:07 PM
1 Kudo
Thats works very well, thank you once again.
... View more
01-25-2018
10:20 AM
1 Kudo
Hey, I want to import data of an ftp (which is updated daily) to cassandra by using Apache NIFI. I got the process so far, but i need to update my database every day with data of the day before. It would work when I m uploading the whole file every day, but I want to have just the new lines of this specific day(the day before) as a flow file. For example: Todays date is 2018-01-25 and the data on my ftp looks something like this: date(timestamp) abc ghi xyz 2018-01-23 11:00 Null 222 44 2018-01-23 12:00 Null 222 44 2018-01-23 13:00 Null 222 44 2018-01-23 14:00 Null 222 44 2018-01-23 15:00 Null 222 44 2018-01-24 11:00 Null 222 44 2018-01-24 12:00 Null 222 44 2018-01-24 13:00 Null 222 44 2018-01-24 14:00 Null 222 44 2018-01-24 15:00 Null 222 44 Before inserting it to cassandra I convert it from csv to json, so it looks like this: (date : YYYYmmDDhh) [{"xyz":"44","date":"2018012311","abc":"Null","ghi":"222"}, {"xyz":"44","date":"2018012312","abc":"Null","ghi":"222"}, {"xyz":"44","date":"2018012313","abc":"Null","ghi":"222"}, {"xyz":"44","date":"2018012314","abc":"Null","ghi":"222"}, {"xyz":"44","date":"2018012315","abc":"Null","ghi":"222"}, {"xyz":"44","date":"2018012411","abc":"Null","ghi":"222"}, {"xyz":"44","date":"2018012412","abc":"Null","ghi":"222"}, {"xyz":"44","date":"2018012413","abc":"Null","ghi":"222"}, {"xyz":"44","date":"2018012414","abc":"Null","ghi":"222"}, {"xyz":"44","date":"2018012415","abc":"Null","ghi":"222"}] I want to replace my flowfile/extract now all data of date "20180124" for my following processors. I thought about using a possibility to get the date one day ago by using the nifi express language: "${now():toNumber():minus(86400000):format('yyyyMMdd')}" - this shows me the date of yesterday. But where do I have to set it up. What processor is recommended? Is it maybe possible as a regex in a Replace Text processor? Or an Extract Text Processor? Something like: Search value: ^.*(\{${now():toNumber():minus(86400000):format('yyyy-MM-dd')\}$ - I guess thats not how regex works though. My process looks like: ListFTP -> FetchFTP -> ConvertRecord (CSV to JSON) -> ????? -> SplitJSON -> EvaluateJSONPath/UpdateAttribute -> ReplaceText (insert into) -> PUTCassandraQL Any help is much appreciated!
... View more
Labels:
- Labels:
-
Apache NiFi
12-01-2017
11:03 AM
Fixed this problem by creating and using the cqlshrc file like this: http://docs.datastax.com/en/cql/3.1/cql/cql_reference/cqlshrc.html#clqshrc__cqlshrcOptions I used "CET" for my timezone and it works so far.
... View more
12-01-2017
08:21 AM
Hey, I am working on cassandra 3.0
and I am struck at how to change the default time zone in cassandra.
Default is Greenwich time or UTC or +00:00 offset. I need to convert the
default time to another timezone. I
tried many sources and I am not able to figure it out. For example: When doing a query like this: "select * from table WHERE time > 11:00 (HH:mm) AND time < 15" The result is: all times between 11:00 and 13:00 which is wrong. The result has to be 12:00, 13:00 and 14:00. My actual time zone is +01:00. Thanks in advance.
... View more
11-28-2017
11:21 PM
Unfortunately the same error is occuring. I tried some more of those formats, but it seems like they have all the same issue.
... View more
11-28-2017
08:56 PM
Hey, I m having some issues with converting a regular timestamp in cassandra with Apache Nifi. My use case is following: I have a csv file with a date in it looking like this ('2015010109') and I want to put it in cassandra by converting this string ('2015010109') to an proper format: 2015-01-01 09:00 -> yyyy/MM/dd HH:mm (I dont exactly need the minutes, but I guess it is more useful for later usage) So far I got this propertie in my UpdateAttribute processor when trying to convert this string to a timestamp: date : ${csvfiledate:toDate("yyyyMMddHH","GMT"):format("yyyy-MM-dd-HH")} but then there is an error occuring in my PutCassandraQL processor: Unable to coerce '2015-01-01-09' to a formatted date (long). By now I didnt try to set the minutes (always mm = 00), because I dont have them in my string out of the csv-file yet. But I guess I need them, because of the certain set of string date formats which can only be coerced: http://docs.datastax.com/en/archived/cql/3.0/cql/cql_reference/timestamp_type_r.html I didnt manage to do it though, maybe you got some tipps. Thanks in advance.
... View more
Labels:
- Labels:
-
Apache NiFi
11-15-2017
03:22 PM
1 Kudo
Thank you very much! It worked very well for me!
... View more
11-14-2017
01:35 PM
1 Kudo
Hi, I ingested csv files using ListFile and FetchFile processors. Those files contain dates of 2016 in it which should all be deleted before saving it in cassandra. The table looks like this: I got a problem with extracting/deleting these lines: It looks like this: with following properties in RouteText (testing it out with different options) It is still sending all lines to the next processor. (or none) Do you have an idea of an solution? Thanks in advance! best regards
... View more
Labels:
- Labels:
-
Apache NiFi
11-09-2017
08:34 AM
But I didnt manage to extract .tar nor .zip files with CompressContent. I have many different files (.tar.gz, .tar, .zip ...) which should all be decompressed/extracted at the end. I thought first of all I get to know all .gz files to decompress them (see first two processors in my screenshot), after that I want to extract all other files (.tar and .zip) what happens in the following two processors. For example: Getting an 'test.tar.gz', decompressing it to 'test.tar' and extracting it to 'test' afterwards.
... View more
11-09-2017
08:32 AM
I managed to solve it by using those identify.mime.type-processors. But there is still a setting which leads to fill my hard drive completely. I
guess UnpackContent is always getting new files to extract them, but
when getting files in GetFile-processor I need to keep the source files,
do you have any idea what I need to change?
... View more