9
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

cqlsh の mysql でいうあれやこれ

Last updated at Posted at 2015-01-06

自分用メモ。
Cassandraのドキュメント少なすぎるよ・・・

呼称

mysql cqlsh
database keyspace
table columfamily
key colum

コマンド

DB一覧

mysql

SHOW databases;

cqlsh

SELECT keyspace_name FROM system.schema_keyspaces ;

テーブル一覧

mysql

USE database1;
SHOW tables;

cqlsh

SELECT columnfamily_name FROM system.schema_columnfamilies WHERE keyspace_name = 'database1';

or

DESCRIBE COLUMNFAMILIES;

テーブル定義の表示

mysql

DESCRIBE table1;

cqlsh

DESCRIBE TABLE table1;
or 
DESCRIBE COLUMNFAMILY table1;

データのエクスポート

mysql

$ mysqldump -u user1 -h localhost -p database1 table1 > export_data.txt

cqlsh

cqlsh > COPY keyspace.table (column1, column2, ..) TO 'export_data.txt' 
WITH DELIMITER = ',' AND QUOTE = '''' AND ESCAPE = '''' AND NULL = '<null>';
9
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?