Member since
04-12-2019
7
Posts
0
Kudos Received
0
Solutions
06-24-2019
05:30 PM
I have an Avro which uses another record type and fixed type Avro as fields types. I have all of them in the schema registry: [
{
"type": "fixed",
"name": "uuid",
"size": 16
},
{
"type": "record",
"name": "ParamValue",
"fields": [
{
"name": "values",
"type": {
"type": "map",
"values": [
"null",
"boolean",
"int",
"long",
"float",
"double",
"bytes",
"string",
"uuid",
{
"type": "array",
"items": [
"boolean",
"int",
"long",
"float",
"double",
"bytes",
"string",
"uuid",
"ParamValue"
]
},
"ParamValue"
]
}
}
]
},
{
"type": "record",
"name": "Action",
"fields": [
{
"name": "modifiedBy",
"type": [
"null",
"uuid"
],
"default": null
},
{
"name": "parameterValues",
"type": "ParamValue",
"default": {
"values": {}
}
}
]
}
] I am trying to convert the Serialized Action Instance Avro to JSON using NIFI convert record processor but getting below error java.lang.IllegalArgumentException: Cannot set the default value for field [parameterValues] to [{values={}}] because that is not a valid value for Data Type [RECORD]
at org.apache.nifi.serialization.record.RecordField.<init>(RecordField.java:65)
at org.apache.nifi.avro.AvroTypeUtil.addFieldToList(AvroTypeUtil.java:630)
at org.apache.nifi.avro.AvroTypeUtil.createSchema(AvroTypeUtil.java:474)
at org.apache.nifi.avro.AvroTypeUtil.createSchema(AvroTypeUtil.java:444)
at org.apache.nifi.avro.AvroTypeUtil.createSchema(AvroTypeUtil.java:435)
at org.apache.nifi.avro.AvroReaderWithEmbeddedSchema.<init>(AvroReaderWithEmbeddedSchema.java:38)
at org.apache.nifi.avro.AvroReader.createRecordReader(AvroReader.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega For simple Avro's, the convert record processor is working but it is failing for this Avro conversion.
... View more
Labels:
05-06-2019
01:41 PM
I am implementing a scenario where I am fetching data from HBase using Scan Processor and then I delete those data and do other things. When no data is found during the HBase scan the processor does not let the flow continue and as a result, remaining processors do not get called. I tried using the original here, but the downside to is if the data is present the other processors are called twice. First time for Original and second time for success. Is there any way I could prevent the other processors getting called twice?
... View more
Labels:
05-02-2019
04:57 PM
Thanks @Shu I had done the same in my case with some minor modifications.
... View more
05-01-2019
08:33 PM
Thanks @Shu. But this does not solve my problem. It does remove the \ from the json but the response is still not in the json response. {"someValue":"[{"id":"6f7f8ffe-4837-4fc1-a5b9-45bc35727b69","name":"da_st","doc":"unknown","pnId":"2846e8e1-5b17-490c-a99e-df1f1e3fa009","status":"Approved","scope":"Global","dateModified":"2019-04-19T11:26:02Z"},{"id":"3559741f-76f6-4fb4-b919-6def5e0511fe","name":"Het","doc":"unknown","pnId":"2846e8e1-5b17-490c-a99e-df1f1e3fa009","status":"Approved","scope":"Global","dateModified":"2019-04-19T11:26:00Z"},{"id":"3b66fbda-9a16-48ac-9fd0-122e3826ef80","name":"queue","doc":"unknown","pnId":"2846e8e1-5b17-490c-a99e-df1f1e3fa009","status":"Approved","scope":"Global","dateModified":"2019-04-19T11:26:01Z"}]"} The response should have been : {"someValue":[{"id":"6f7f8ffe-4837-4fc1-a5b9-45bc35727b69","name":"da_st","doc":"unknown","pnId":"2846e8e1-5b17-490c-a99e-df1f1e3fa009","status":"Approved","scope":"Global","dateModified":"2019-04-19T11:26:02Z"},{"id":"3559741f-76f6-4fb4-b919-6def5e0511fe","name":"Het","doc":"unknown","pnId":"2846e8e1-5b17-490c-a99e-df1f1e3fa009","status":"Approved","scope":"Global","dateModified":"2019-04-19T11:26:00Z"},{"id":"3b66fbda-9a16-48ac-9fd0-122e3826ef80","name":"queue","doc":"unknown","pnId":"2846e8e1-5b17-490c-a99e-df1f1e3fa009","status":"Approved","scope":"Global","dateModified":"2019-04-19T11:26:01Z"}]} The quotes should not be present before and after the array brackets([]).
... View more
04-30-2019
01:47 PM
I fetched the data from hbase using fetchHbaseRow and the response is in json format. but the value for the attribute is array of objects and it is having escaped characters in there. A sample response is posted below: {"someValues":"[{\"a\":\"6f7f8ffe-4837-4fc1-a5b9-45bc35727b69\",\"b\":\"da_states\",\"doc\":\"unknown\",\"idNew\":\"2846e8e1-5b17-490c-a99e-df1f1e3fa009\",\"status\":\"Approved\",\"scope\":\"Global\",\"dateModified\":\"2019-04-19T11:26:02Z\"}]"} I need to split the objects in array and because of escape characters I am not able to. @Matt Burgess
... View more
04-25-2019
09:50 AM
Hi, I am using SiteToSiteClient to connect to my nifi and to initialize the site to site client , I pass the urls(http//IP:8080/nifi) and port name (Name of the input port) in my spring boot Rest service. When I run this on my local, the service connects to nifi. But when I deploy it to linux server the service tries to connect to port 10000 instead of 8080.
... View more
Labels:
04-12-2019
02:09 PM
I am new to Nifi, I am trying to create a process group which takes an authentication token using get port and makes call to Api. I have used Httpprocessor to fetch the data, after fetching the data I am taking some data, let's say an I'd using EvaluateJSONPath and passing it to a new hero processor to fetch some other data. But I am not able to pass the token that I received at the very start of the process group. Is there any way I can set the token received global for all process in processorgroup ?? We can set a global variable for processorGroup but can it's value be made dynamic instead of static ??
... View more
Labels: