Thuy Le
Thuy Le

Reputation: 11

Nifi insert data to druid on docker

I have 2 docker-containers installed in different servers

  1. docker-druid
  2. docker-NiFi

When I used NiFi to insert data to druid, I had this error:

Nifi insert data to druid

Do you have any ideas? How do this configuration for druid?

Thank you so much :)

Upvotes: 0

Views: 386

Answers (1)

notNull
notNull

Reputation: 31510

As you are using in your Reader/Writer controller services

Schema Access Strategy as Use 'SchemaName' Property then

Make sure you are having schema.name attribute associated with the flowfile.

To add the attribute use Update Attribute processor

add new property called schema.name and value as schema_name

Example:

if you are using AvroSchemaRegistry to access the schema then the name of the schema will be your schema.name attribute value.

For more details refer to this link and look into configs of UpdateAttribute processor in the flow.

Update:

As per your sample data instead of using JsonPathReader use JsonTreeReader and JsonSetWriter controller services.

You are missing schema property in AvroSchemaRegistry controller service.

in AvroSchemaRegistry add property by clicking + sign at top right

demo

{
    "type": "record",
    "name": "balances",
    "namespace": "nifi",
    "fields": [{
        "name": "submit_date",
        "type": ["null",
        "string"]
    },
    {
        "name": "request_type",
        "type": ["null",
        "string"]
    },
    {
        "name": "origin",
        "type": ["null",
        "string"]
    },{
        "name": "description",
        "type": ["null",
        "string"]
    }]
}

Upvotes: 2

Related Questions