Adding custom SQL files in NiFi
You can add custom SQL files in NiFi using the NiFi toolkit and a custom NAR file.
Before you begin
Ensure that you have the NiFi toolkit installed and correctly configured for your
environment. In addition, ensure that you have installed and configured the
HCL_Commerce_Search_Bundle project on your local machine. This
process is described in detail in steps 1 to 7 of Commerce+ Developer Elasticsearch-based Search NiFi environment.
Procedure
- Create the following directory structure:
-
Add your custom SQL files inside the custom folder. The
naming convention for such custom SQL files is to use the prefix
X_followed by the name of the SQL file. For example, you could create a file named X_DatabaseProductStage1a. - Build a custom NAR file by following steps t_createcustomNAR.html#BuildingNARFile__step1 and t_createcustomNAR.html#BuildingNARFile__step2 of t_createcustomNAR.html.
- Deploy the custom NAR file by following steps t_createcustomNAR.html#BuildingNARFile__step3 and t_createcustomNAR.html#BuildingNARFile__step4 in the same topic.
-
Once the custom NAR file is deployed, modify the value of the SQL location for
the respective process group and point it to the new SQL file.
The value of the SQL location variable in ProductStage1a will change from sql/DatabaseProductStage1a.sql to sql/custom/X_DatabaseProductStage1a.sql.