PowerExchange for Cassandra User Guide

PowerExchange for Cassandra User Guide

Virtual Table Operations Examples

Virtual Table Operations Examples

The example mappings illustrate the operations that you can perform on a virtual table.
The login details of users are stored in a Cassandra column family. You need to read, insert, update, append, or delete values from the location column.
The following users_list table represents a Cassandra column family that contains a collection of type list:
username
first_name
last_name
city
last_login
location
user1
john
doe
SFO
2014-8-03 01:30:00
0.0.0.0, 123.123.123.2
user2
jane
smith
NYC
2014-8-03 01:40:00
123.88.99.2, 0.0.0.0
user3
brian
lee
SFO
2014-8-04 11:15:00
123.123.2.2, 127.0.0.0
user4
james
adam
NYC
2014-8-05 05:22:00
123.123.1.2, 127.0.0.0
The Informatica Cassandra ODBC driver creates the users_list main table and users_list_vt_location virtual table.
The following image displays the users_list main table:
The image shows the data preview of a source table for a list collection.
The following image displays the users_list_vt_location virtual table:
The image shows the data preview of the virtual table for a list collection.
The following example mappings and data preview illustrate the virtual table operations:
Read Operation
The following image displays the data preview of the users_list_vt_location virtual table:
The image shows the data preview of the list read operation.
Insert Operation
The following pass-through mapping inserts rows into a virtual table:
The image shows the mapping of an insert operation to insert rows into the target table.
The mapping source is the users_list_vt_location table. The mapping target is the users_list_tgt_vt_location table.
The following image displays the data preview of the target virtual table:
The image shows the data preview of a list table after inserting rows into the target table.
Update Operation
You can use a DD_UPDATE constant in an Update Strategy transformation to update rows in a virtual table.
The following mapping uses an Update Strategy transformation to update rows in a virtual table:
The image shows the mapping of an update operation on a Cassandra list. The mapping uses an update strategy transformation to update rows in the target table.
The mapping source is the users_list_vt_location table. The DD_UPDATE constant in the Update Strategy transformation updates rows in the target virtual table. The mapping target is the users_list_tgt_vt_location table.
Append Operation
You can append rows only to virtual tables created for list type.
The following mapping appends the location value to each user in the list in the users_list_tgt_vt_location table:
The image shows the mapping of an append operation on a Cassandra list. The mapping uses an expression transformation to append rows in the target table.
The mapping source is the users_list_vt_location table. The Expression transformation sets the list index to -1. The mapping target is the users_list_tgt_vt_location table.
The following image displays a data preview of the rows in the target table before you append rows in the target table:
The image shows the data preview of the list table before you append rows in the target table.
The following image displays a data preview of the rows appended in the target virtual table:
The image shows the data preview of the list table after you append rows in the target table.
Delete Operation
You can use a DD_DELETE constant in an Update Strategy transformation to delete rows from a virtual table.
The following mapping uses an Update Strategy transformation to delete rows from a virtual table:
The image shows the mapping of a delete operation on a Cassandra list. The mapping uses an update strategy transformation to delete rows from the target table.
The mapping source is the users_list_vt_location table. The DD_DELETE constant in the Update Strategy transformation deletes rows from the target virtual table. The mapping target is the users_list_tgt_vt_location table.

0 COMMENTS

We’d like to hear from you!