Reputation: 1477
Execute a sql and write result(flow file) using my own schema to a file directly.
Please see the explanation blow.
ExecuteSql
and the records has auto-generated(embedded) avro schema.ConvertRecord
: The Record Reader just use embedded avro schema and the Record Writer use my own schema from HortonworkSchemaRegistry, so pass attributes - 'schema.name' and 'schema.version' - by using UpdateAttribute
.ExecuteSqlRecord
)It may like this:
ExecuteSqlRecord
has Record Writer
And the Record Writer get avro schema from HortonworkSchemaRegistry using 'schema.name' and 'schema.version' attributes
But ExecuteSqlRecord
not support user-define-attributes
ExecuteSqlRecord
processor?Upvotes: 0
Views: 3586
Reputation: 31540
As for now, Users cannot add new properties to ExecuteSQL*
processors.
Below are the ways you can try
Using GenerateFlowFile
processor
schema.name
attribute with some value.Flow:
1.GenerateFlowFile //add schema.name attribute with value.
2.ExecuteSQLRecord
2.PutFile
(or)
hard code
schema.name
value in RecordWriter controller service. in this case you don't need GenerateFlowFile processor.Flow:
1.ExecuteSQLRecord //hardcode schema.name property value
2.PutFile
Upvotes: 2