Create new table based on the result of query in Cassandra

Viewed 154

I have a question regarding making a new table based on the result of a query in Cassandra, in SQL we have the INTO clause which can create a new table using the result of a query. Is there any way we can do it in Cassandra's shell? I'm sorry if my question is not very clear.

So in my case, I have to filter using a field in one of the UDT of the table. For example:

id | name

some_id | {first: "John", last: "Doe"}

I know that we can't filter using only the first or the last name because they're part of the name type so I want to get every first name and create a new table for them then I can find the name I want. Any help would be very appreciated.

Thank you.

1 Answers

Within CQL, it is not possible to perform this operation. It can be done as a spark job, selecting / filtering the data you wish to place into a second table you have created, and then inserting.

Related