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'
- 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'
- Port:
- Port for communication with CQL engine (default is 9042)
- 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:
- 900 (in seconds)
- Request Timeout:
- 60 (in seconds)
- Consistency Level:
- Default consistency level, e.g. LOCAL_ONE, LOCAL_QUORUM, etc.
- 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.
- Write Consistency Level:
- E.g. LOCAL_ONE, LOCAL_QUORUM, etc.
- 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 table will be used for value conversions from the CSV file.
- Batch Size:
- Size of batch for write to CQL (default is 200)
- Dry Run:
- The simulation of write to CQL (default is false)