Member since
06-20-2017
10
Posts
2
Kudos Received
0
Solutions
11-06-2017
01:32 PM
Hi Arti. Thank you for suggestion. Yes, it's HA enabled. And you are right, the name i was looking for exists both in core-site.xml and hdfs-site-xml. My bad -- I was looking older files, so didn't see it. I need to examine these conf files a bit more. I'll update the thread about my progress in configuring this processor. Hopefully, it'll go smooth.
... View more
11-03-2017
12:37 PM
I get the following error when using PutHiveStreaming processor. It's version 1.2.0, so the bug reported for 1.0.0 shouldn't be the case. I can't ping nameservice01 from the host itself too. And I don't remember creating a host or config file named as nameservice01. Where should I look to fix this? From which file PutHiveStreaming takes the name nameservice01? I have looked into hive-site.xml, but it's not there. ERROR [Timer-Driven Process Thread-10] o.a.n.processors.hive.PutHiveStreaming PutHiveStreaming[id=0cef11a0-015d-1000-0000-000053b255ae] Error writing [org.apache.nifi.processors.hive.PutHiveStreaming$HiveStreamingRecord@184cb76e] to Hive Streaming transaction due to java.lang.IllegalArgumentException: java.net.UnknownHostException: nameservice01: java.lang.IllegalArgumentException: java.net.UnknownHostException: nameservice01
java.lang.IllegalArgumentException: java.net.UnknownHostException: nameservice01
Any help would be appreciated. Thanks.
... View more
Labels:
- Labels:
-
Apache NiFi
10-23-2017
10:49 AM
1 Kudo
Just wanted to add another way of doing this which occurred to me later. It is by using the UpdateRecord twice: first for adding another field (column) as the copy of some field in the record; the second one for manipulating that record, such as /heightmm ${field.value:theFunctionOfUse}
This does the trick, and it works as expected.
... View more
10-10-2017
05:19 AM
Thanks a lot @Shu. That explained it all.
... View more
10-09-2017
02:11 PM
Yes, it was due to schema. I changed it, and now it works. I have one small question though. In the record, I have a field height. Now I want to create heightmm: that is height in mm which is equal to height * 10. How can I do this using the UpdateRecord? Because I have two options to choose for property, literal or record path value, I can't do it. It seems like there is no short way of doing this. I am using Nifi version 1.2.0.
... View more
10-09-2017
12:26 PM
Skipping SplitRecord solved this issue. Now routing directly from UpdateAttribute to UpdateRecord sets the height to desired value. But the main point of my post still not solved -- add field to csv file based on another field value. For example adding a property (inside UpdateRecord) such as heightinmm and setting it to height*10. From the UpdateRecord manual it says that if the field (property) not present in the record, the UpdateRecord processor creates that field (and the value as intended). But in my case, this didn't work. I think this is due to the schema.name.
... View more
10-09-2017
11:38 AM
@Shu I tried that as well, but still the same issue. UpdateRecord takes that split input (4 records), but produces output of size 0 (thought it's still 4 records). Shouldn't UpdateRecord at least produce output without changing anything (for example if it can't find /height in the file?). This is confusing. I am working on this now. I'll update the post as soon as I find solution. Thanks a lot for your time and suggestions.
... View more
10-05-2017
02:49 PM
1 Kudo
Hi @Shu, thanks for the detailed reply. But I would prefer using Record-based processors (such as SplitRecord and UpdateRecord) since CSV is considered record-based as well. But I am faced with a problem and can't figure it out. I would appreciate if you could suggest a solution or point me in the right direction. Here is what I have done: create sample csv file name,age,height,weight,school
james, 19, 173, 56, NY
jake, 20, 177, 62, MD
sam, 21, 160, 55, KN
Mike, 24, 170, 64, MM created AvroSchemaRegistry {
"name": "origFormatName",
"namespace": "someFields",
"type": "record",
"fields": [
{ "name": "name", "type": "string" },
{ "name": "age", "type": "int" },
{ "name": "height", "type": "int" },
{ "name": "weight", "type": "int" },
{ "name": "school", "type": "string" }
]
}
Then CSVReader and CSVRecordSetWriter contoller services (referencing the same AvroSchema) Then using UpdateAttribute I update the file's attribute by adding property schema.name=thename This successfully adds the attribute. Afterwards, I use SpliteRecord and set the Record Reader and Record Writer property as appropriate (Records Per Split = 1). It does split the file into 4 records as expected. Then I use UpdateRecord. And again set Record Reader and Record Writer. And for Replacement Value Strategy I set value to Literal Value for simplicity. Then add a property as below /fields[2]/height = 2222 Then I get the 4 records (as expected) coming from UpdateRecord. But they are all size=0. I can't understand why would it return size 0. Any help would be appreciated. Thanks.
... View more
09-07-2017
07:40 AM
Hi folks, I would like to add a field to csv file based on another field value. For example, I have timestamp field, and I add a date field which I set as trunc(timestamp). Any ideas how could I do this with Nifi? (Afterwards, I am converting this to avro and inserting into Hive) Thanks.
... View more
Labels:
- Labels:
-
Apache Hive
-
Apache NiFi