You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by amit tewari <am...@gmail.com> on 2015/05/20 07:29:05 UTC

Does Cassandra CQL supports 'Create Table as Select'?

Hi

We would like to have the ability of being able to create new tables from
existing tables (on the fly), but with with a new/different partition key.

Can this be done from CQL?

Thanks
Amit

Re: Does Cassandra CQL supports 'Create Table as Select'?

Posted by Jack Krupansky <ja...@gmail.com>.
The upcoming Materialized View feature should accomplish this.

See:
https://issues.apache.org/jira/browse/CASSANDRA-6477

Maybe it's a question of whether your are doing a one-time migration of
data to a new table, or in fact you want to maintain and update views of a
base table that will be updated.

In any case, it is not yet clear when exactly this new feature will be
available. But it would be nice to hear confirmation of whether it would
suit your needs.


-- Jack Krupansky

On Wed, May 20, 2015 at 1:53 AM, Jonathan Haddad <jo...@jonhaddad.com> wrote:

> Here's a simple example I did a little while ago that might be helpful:
> https://github.com/rustyrazorblade/spark-data-migration
>
> On Tue, May 19, 2015 at 10:53 PM Jonathan Haddad <jo...@jonhaddad.com>
> wrote:
>
>> It's not built into Cassandra.  You'll probably want to take a look at
>> Apache Spark & the DataStax connector.
>>
>> https://github.com/datastax/spark-cassandra-connector
>>
>> Jon
>>
>> On Tue, May 19, 2015 at 10:29 PM amit tewari <am...@gmail.com>
>> wrote:
>>
>>> Hi
>>>
>>> We would like to have the ability of being able to create new tables
>>> from existing tables (on the fly), but with with a new/different partition
>>> key.
>>>
>>> Can this be done from CQL?
>>>
>>> Thanks
>>> Amit
>>>
>>

Re: Does Cassandra CQL supports 'Create Table as Select'?

Posted by Jonathan Haddad <jo...@jonhaddad.com>.
Here's a simple example I did a little while ago that might be helpful:
https://github.com/rustyrazorblade/spark-data-migration

On Tue, May 19, 2015 at 10:53 PM Jonathan Haddad <jo...@jonhaddad.com> wrote:

> It's not built into Cassandra.  You'll probably want to take a look at
> Apache Spark & the DataStax connector.
>
> https://github.com/datastax/spark-cassandra-connector
>
> Jon
>
> On Tue, May 19, 2015 at 10:29 PM amit tewari <am...@gmail.com>
> wrote:
>
>> Hi
>>
>> We would like to have the ability of being able to create new tables from
>> existing tables (on the fly), but with with a new/different partition key.
>>
>> Can this be done from CQL?
>>
>> Thanks
>> Amit
>>
>

Re: Does Cassandra CQL supports 'Create Table as Select'?

Posted by Jonathan Haddad <jo...@jonhaddad.com>.
It's not built into Cassandra.  You'll probably want to take a look at
Apache Spark & the DataStax connector.

https://github.com/datastax/spark-cassandra-connector

Jon

On Tue, May 19, 2015 at 10:29 PM amit tewari <am...@gmail.com> wrote:

> Hi
>
> We would like to have the ability of being able to create new tables from
> existing tables (on the fly), but with with a new/different partition key.
>
> Can this be done from CQL?
>
> Thanks
> Amit
>