You can use NiFi processor (nifi-cql-nar-*.nar).
- ✅ PutCQL as NiFi v2 processor with controller, where inputs are FlowFiles
You have to do these steps (only one-time action):
- You need the NAR file 'nifi-cql-nar-*.nar'
- the last version is here
- Import the *.nar file to the NiFi lib directory
- expected location in Linux e.g. '/opt/nifi/current-nifi/lib'
- expected location in Windows e.g. 'C:\Program Files\Apache\Nifi\lib'
- STOP NiFi
- START NiFi
- IP Addresses:
- IP addresses of CQL engine with comma delimiter e.g. '10.129.53.10, 10.129.53.11, 10.129.53.12' or 'localhost', etc.
- Port:
- Port for communication with CQL engine (default is 9042).
- Secure Connection Bundle:
- Secure Connection Bundle for access to AstraDB (it is the link to '*.zip' file, downloaded from AstraDB web).
- NOTE: the 'username' is 'clientId' and 'password' id 'secret', these values are from the file '*-token.json', downloaded from AstraDB web.
- Username:
- Username for login to CQL.
- Password:
- Password for login to CQL.
- Local Data Center:
- Name of local data center in CQL typically e.g. 'dc1' or 'datacenter1', etc.
- Connection Timeout:
- Connection timeout in seconds (default is 900 seconds).
- Request Timeout:
- Request timeout in seconds (default is 60 seconds).
- Consistency Level:
- Default consistency level (e.g. LOCAL_ONE, LOCAL_QUORUM, etc., default is LOCAL_ONE).
- SSL Context Service:
- SSL context service for CQL connection (default is without setting).
- FlowFile with CSV content for import (content see), where the CSV content (with header) is based on 'keyspace.table' definition in CQL (from data types point of view).
- cql.count (FlowFile attribute)
- The amount of write rows to CQL.
- Service Controller:
- see relation to CQLControllerService
- Write Consistency Level:
- Consistency level for write operation (e.g. LOCAL_ONE, LOCAL_QUORUM, etc., default is LOCAL_ONE).
- Table:
- Schema and table name in CQL for write/put a data (expected format 'keyspace.table', e.g. 'cqlschema.cqltable').
- The data types defined in the CQL table will be used for value conversions from the CSV file.
- Batch Size:
- Size of batch for write to CQL (default is 200).
- Batch Type:
- Batch type with relation to an atomicity of batch operation (default UNLOGGED, it is without atomicity).
- Dry Run:
- The simulation of write to CQL (default is false).