Apache Nifi Technology Insider

2.3.3 Data access processor unit
ConvertJSONToSQL

The ConvertJSONToSQL processor unit can convert the structured Json into SQL of commands such as INSERT or UPDATE, and with the PutSQL processor unit, the data can be inserted into the database directly according to the shoe command.

The above figure shows that the Processor converts JSON into the SQL statement of Update according to the JSON content of the input FlowFile.
ExecuteSQL

The ExecuteSQL processor unit directly runs the SQL query statement configured by the user, and writes the query result into the content of the FlowFile in Avro format.

The above figure shows that the Processor queries the results from the database according to the user configuration SQL select query statement, and maps the result FlowFile to the relationship of success.
PutSQL

The PutSQL processor unit can update the database according to the DDM SQL in the incoming FlowFile content.

The above figure shows that the Processor submits the database every 100 SQLs as a transaction according to the SQL content of the input FlowFile, returns the generated Key and rolls back the transaction if the transaction submission fails.
SelectHiveQL

The SelectHiveQL processor unit executes the Hive query statement HiveQL, and writes the results to FlowFile in Avro or CSV format.

The above figure shows that the Processor queries Hive according to the HiveQL statement, and outputs the results in CSV format. The CSV has Header as username and age.
PutHiveQL The
PutHiveQL processor updates the content of the Hive data warehouse according to the incoming HiveQL DDM statement. The above figure shows that the Processor writes or updates data to Hive according to the HiveQL in the input FlowFile.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324650521&siteId=291194637