How to select data from a table and insert into another table?

后端 未结 3 562
我寻月下人不归
我寻月下人不归 2021-01-31 20:20

I want to select specific fields of a table in cassandra and insert them into another table. I do this in sql server like this:

INSERT INTO Users(name,family)
         


        
3条回答
  •  [愿得一人]
    2021-01-31 20:38

    For tables that are not very large, save yourself the file and use an anonymous pipe:

    cqlsh -e "COPY keyspace.src_table (col1, col2, ...,ColN ) TO STDOUT WITH HEADER=false" | cqlsh -e "COPY keyspace.target_table (col1, col2, ...,ColN ) FROM STDIN" 
    

    For very large datasets, this won't work. A strategy of per token range should be explored

提交回复
热议问题