I have json file for the schema that looks like the following:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"stats": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"bin_qualifier": {
"type": "string"
}
}
}
},
"additionalProperties": false,
"description": "attributes",
"type": "object",
"properties": {
"id": {
"type": "string",
"required": true,
},
"create_date": {
"type": "integer",
"javaType": "java.math.BigInteger",
"required": true
}
}
}
How can I add this schema for JsonTreeReader?
On Thu, Aug 30, 2018 at 9:02 AM Otto Fowler <[email protected]> wrote:
> The record readers are services, that processors use.
> When you use a *Record* processor, you will have to select a Reader and a
> Writer Service, or create one ( which you can do through the UI ).
> https://blogs.apache.org/nifi/entry/record-oriented-data-with-nifi
>
>
> On August 30, 2018 at 08:48:08, l vic ([email protected]) wrote:
>
> So, where's JsonTreeReader? I am on nifi-1.7.1-RC1 and i don't see it in
> the list of available processors...
> Thanks,
> V
>
> On Thu, Aug 30, 2018 at 5:31 AM Sivaprasanna <[email protected]>
> wrote:
>
>> Hi. Just like CSVRecordReader, we have record reader service for JSON.
>> It's called JsonTreeReader. You can use AvroSchemaRegistry and provide an
>> Avro schema (usually generated through InferAvroSchema processor) for your
>> JSON. Refer:
>> https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-record-serialization-services-nar/1.7.1/org.apache.nifi.json.JsonTreeReader/index.html
>>
>> -
>> Sivaprasanna
>>
>> On Thu, 30 Aug 2018 at 2:21 PM, l vic <[email protected]> wrote:
>>
>>> I need to save two different json messages according to json schemas
>>> available for each to different relational database tables.
>>> I saw this blog:
>>> https://blogs.apache.org/nifi/entry/record-oriented-data-with-nifi
>>> with example using CSVRecordReader for csv->json transformation.
>>> but what would be RecordReader for schema-based transformation from
>>> json? Is this a valid approach, or what would be best approach to solve
>>> this problem?
>>> I am using: nifi-1.7.1-RC1...
>>> Thank you,
>>>
>>