Importing joined tables
A common use case example imports multiple tables, which are joined in SQL, to Cassandra.
A common use case is to import multiple tables, which are joined in SQL, to Cassandra. This example shows how to import two tables from MySQL. In MySQL, you use query joins to get famous quotations from one table and the author of the quotation from another. For example:
mysql> SELECT * FROM person INNER JOIN mysql_quotations ON person.id=mysql_quotations.speaker;
+-----+--------------------+---------+----+---------+--------------------------------------------------------------+ | id | name | title | id | speaker | quote | +-----+--------------------+---------+----+---------+--------------------------------------------------------------+ | 123 | Christopher Morley | Life | 1 | 123 | Life is a foreign language; all men mispronounce it. | | 123 | Christopher Morley | Life | 2 | 123 | There are three ingredients in the good life: learning . . . | | 124 | Daniel Akst | Life | 3 | 124 | In matters of self-control as we shall see again and . . . | | 124 | Daniel Akst | Life | 4 | 124 | We Have Met the Enemy: Self-Control in an Age of Exc. . . | | 125 | Abraham Lincoln | Success | 5 | 125 | Always bear in mind that your own resolution to . . . | | 125 | Abraham Lincoln | Success | 6 | 125 | Better to remain silent and be thought a fool than . . . | | 126 | Albert Einstein | Success | 7 | 126 | If A is success in life, then A equals x plus y plus . . . | +-----+--------------------+---------+----+---------+--------------------------------------------------------------+ 7 rows in set (0.00 sec)
This example assumes you have started an Analytics node. To import SQL tables into CQL using a collection set for the quotations, follow these steps.