I have 2 mysql tables as given below
Table Employee:
id int, name varchar
Table Emails
emp_id int, email_add varchar
Table Emails & Employee are connected by employee.id = emails.emp_id
I have entries like:
mysql> select * from employee;
id name
1 a
2 b
3 c
mysql> select * from emails;
empd_id emails
1 aa@gmail.com
1 aaa@gmail.com
1 aaaa@gmail.com
2 bb@gmail.com
2 bbb@gmail.com
3 cc@gmail.com
6 rows in set (0.02 sec)
Now i want to import data to cassandra in below 2 formats
---format 1---
table in cassandra : emp_details:
id , name , email map{text,text}
i.e. data should be like
1 , a, { 'email_1' : 'aa@gmail.com' , 'email_2 : 'aaa@gmail.com' ,'email_3' :'aaaa@gmail.com'}
2 , b , {'email_1' :'bb@gmail.com' ,'email_2':'bbb@gmail.com'}
3, c, {'email_1' : 'cc@gmail.com'}
---- format 2 ----
i want to have the dynamic columns like
id , name, email_1 , email_2 , email_3 .... email_n
Please help me for the same. My main concern is to import data from mysql into above 2 formats.