1

csvReader property set: enter image description here

Here is the schema I created and registered in AvroSchemaRegistry

{ "namespace": "nifi", "type": "record", "name": "users", "fields" : [ {"name": "first_name", "type": "string"}, {"name": "last_name", "type": "string"}, {"name": "age", "type": "int"} ] }

Error I encountered upon running the Apache-nifi processor

org.apache.nifi.schema.access.SchemaNotFoundException: FlowFile did not contain appropriate attributes to determine Schema Text

bentoi
  • 49
  • 4

1 Answers1

0

Configure your CSVReader as -

Schema Access Strategy = Use 'Schema Name' Property

Schema Registry = Your AvroSchemaRegistry Controller Service

Schema Name = users

Schema Text = let it be default value

This means CSVReader will search schema registry for the specified schema name since the access strategy is the schema name, and we are passing it to the registry.

Vikramsinh Shinde
  • 2,742
  • 2
  • 23
  • 29
  • It works like a charm thanks. By the way I'm planning to have an auto increment primary key how will configure it on the schema? thanks. – bentoi Jul 02 '21 at 07:52
  • Can you elaborate on how and where you are using the auto increment primary key? Do you mean schema version? – Vikramsinh Shinde Jul 02 '21 at 07:58
  • In my table the primary key will get its value automatically from the sequence. Here is the way I set the schema db. ** id integer DEFAULT nextval('public.user_row_dtl_seq'::regclass) NOT NULL,** And in my CSV **id** is not added only the firstname, lastname, age. So my question is how will I map these attributes to the db fields using the AvroSchema? As I tried adding the primary key it looks like I always got number exception since the first column being mapped is the firstname. – bentoi Jul 02 '21 at 12:08