Using the Cassandra Destination Component
The Cassandra Destination Component is an SSIS data flow pipeline component that can be used to write/send data to Apache Cassandra.
General Page
The General page of the Cassandra Destination Component allows you to specify the general settings of the component.
- Connection Manager
-
The Cassandra Destination Component requires a Cassandra connection in order to connect with Cassandra. The Connection Manager drop-down will show a list of all Cassandra connection managers that are available to your current SSIS package.
- Keyspace
-
The Keyspace dropdown shows a list of Cassandra Keyspaces available to you. After selecting the Keyspace you wish to write to, the Table dropdown will be populated with Tables in the selected Keyspace.
- Table
-
The Table specifies the Cassandra Collection you wish to write to.
- Action
-
There are 4 available actions:
- Insert: Send new records to the Cassandra Table
- Update: Update existing records in the Cassandra Table
- Upsert: If the specified record exists in the Cassandra Table it is updated otherwise it is inserted.
- Delete: Delete existing records from the Cassandra Table
- Async Mode
-
When Async Mode is enabled performance is significantly increased because multiple requests are processed simultaneously.
- Insert as JSON
-
If the input column data is in JSON format, enable this option. You can send data as JSON for both Insert and Upsert actions. Note for the Upsert action you will not be able to specify key fields in the Columns Page so updates will be done on the primary key of the table.
- Refresh Component Button
-
Clicking the Refresh Component button causes the component to retrieve updated metadata.
- Map Unmapped Fields Button
-
By clicking this button, the component will try to map any unmapped attributes by matching their names with the input columns from upstream components.
- Clear All Mappings Button
-
By clicking this button, the component will reset (clear) all your mappings in the destination component.
- Expression fx Icon
-
Click the blue fx icon to launch SSIS Expression Editor to enable dynamic updates of the property at run time.
- Generate Documentation Icon
-
Click the Generate Documentation icon to generate a Word document that describes the component's metadata including relevant mapping, and so on.
Columns Page
The Columns Page of the Cassandra Destination Component allows you to map the columns from upstream components to fields of the specified Casandra Table in the General Page.
- Key Column: The key checkbox column is used when performing an update (Update or Upsert) where the selected fields represent key columns. These fields are used in the WHERE clause of the UPDATE statement. This column is not available when using INSERT because there is no condition, and not available when using DELETE because every column is a conditional/key field.
- Input Column: Select an Input Column from an upstream component here.
- Destination Table Column: This is the field you are writing data to.
- Data Type: This column indicates the type of value for the current field.
- Unmap: This column can be used to unmap the field from the upstream input column, or otherwise it can be used to map the field to an upstream input column by matching its name if the field is not currently mapped.
Error Handling Page
The Error Handling page allows you to specify how errors should be handled when they happen.
There are three options available.
- Fail on error
- Redirect rows to error output
- Ignore error
When the Redirect rows to error output option is selected, rows that failed to write to Cassandra will be redirected to the 'Error Output' output of the Destination Component. As indicated in the screenshot below, the green output connection represents rows that were successfully written, and the red 'Error Output' connection represents rows that were erroneous. The 'ErrorMessage' output column found in the 'Error Output' may contain the error message that was reported by Cassandra or the component itself.
Note: Use extra caution when selecting Ignore error option, since the component will remain silent for any errors that have occurred.
- Enable Columns for Default Output.
-
_SuccessWrite - A boolean value specifying if the record was successfully written to Cassandra