`
a80317
  • 浏览: 8611 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
最近访客 更多访客>>
文章分类
社区版块
存档分类

Insert super column using Cassandra command line

阅读更多
cassandra> connect 10.240.70.60/9160
Connected to: "Test Cluster" on 10.240.70.60/9160
cassandra> help
List of all CLI commands:
?                                                                  Same as help.
help                                                          Display this help.
connect <hostname>/<port>                             Connect to thrift service.
describe keyspace <keyspacename>                              Describe keyspace.
exit                                                                   Exit CLI.
quit                                                                   Exit CLI.
show config file                                Display contents of config file.
show cluster name                                          Display cluster name.
show keyspaces                                           Show list of keyspaces.
show api version                                        Show server API version.
get <ksp>.<cf>['<key>']                                  Get a slice of columns.
get <ksp>.<cf>['<key>']['<super>']                   Get a slice of sub columns.
get <ksp>.<cf>['<key>']['<col>']                             Get a column value.
get <ksp>.<cf>['<key>']['<super>']['<col>']              Get a sub column value.
set <ksp>.<cf>['<key>']['<col>'] = '<value>'                       Set a column.
set <ksp>.<cf>['<key>']['<super>']['<col>'] = '<value>'        Set a sub column.
del <ksp>.<cf>['<key>']                                           Delete record.
del <ksp>.<cf>['<key>']['<col>']                                  Delete column.
del <ksp>.<cf>['<key>']['<super>']['<col>']                   Delete sub column.
count <ksp>.<cf>['<key>']                               Count columns in record.
count <ksp>.<cf>['<key>']['<super>']            Count columns in a super column.
cassandra> set Keyspace1.Super2['key1']['super1']['column1']='value1'
Value inserted.
cassandra> set Keyspace1.Super2['key1']['super1']['column2']='value2'
Value inserted.
cassandra> set Keyspace1.Super2['key1']['super2']['column1']='value3'
Value inserted.
cassandra> set Keyspace1.Super2['key1']['super2']['column2']='value4'
Value inserted.
cassandra> set Keyspace1.Super2['key2']['super1']['column1']='value5'
Value inserted.
cassandra> set Keyspace1.Super2['key2']['super1']['column2']='value6'
Value inserted.
cassandra> set Keyspace1.Super2['key2']['super2']['column1']='value7'
Value inserted.
cassandra> set Keyspace1.Super2['key2']['super2']['column2']='value8'
Value inserted.
cassandra> get Keyspace1.Super2['key1']
=> (super_column=super2,
     (column=column1, value=value3, timestamp=1279599872232000)
     (column=column2, value=value4, timestamp=1279599881611000))
=> (super_column=super1,
     (column=column1, value=value1, timestamp=1279599818380000)
     (column=column2, value=value2, timestamp=1279599829557000))
Returned 2 results.
cassandra> get Keyspace1.Super2['key2']
=> (super_column=super2,
     (column=column1, value=value7, timestamp=1279599937855000)
     (column=column2, value=value8, timestamp=1279599945124000))
=> (super_column=super1,
     (column=column1, value=value5, timestamp=1279599913391000)
     (column=column2, value=value6, timestamp=1279599921910000))
Returned 2 results.
cassandra>


























































































分享到:
评论
2 楼 smj34521 2012-04-23  
内容怎么少了呢
1 楼 smj34521 2012-04-23  
          

相关推荐

    Cassandra分布式架构与源代码分析

    Super Column是Cassandra中的高级数据类型,包含多个Column。 2.3 Row Row是Cassandra中的基本数据单元,包含多个Column或Super Column。 3. Cassandra的主要特性 Cassandra的主要特性包括分布式基于column的...

    spring boot与cassandra集成,使用JPA方式。

    首先,定义一个Cassandra实体类,比如`User`,并使用`@Table`指定表名,`@Column`指定列名: ```java import org.springframework.data.cassandra.core.cql.PrimaryKeyType; import org.springframework.data....

    Cassandra与HBase系统架构比对.pdf

    standard column family是指一个简单的column family,而super column family是指一个包含多个column的column family。 HBase中没有column family的概念,而是使用region来管理数据。region是HBase中的一种逻辑上的...

    NoSQL Web Development with Apache Cassandra(2015)

    Apache Cassandra is the most commonly used NoSQL database written in Java and is renowned in the industry as the only NoSQL solution that can accommodate the complex requirements of today’s modern ...

    Cassandra的数据模型介绍

    amily 是 Cassandra 数据模型的核心组成部分,用来组织和管理 Column 和 SuperColumn。在 Cassandra 中,一个 ColumnFamily 相当于传统数据库中的表,但它不遵循严格的行与列的关系,而是以键值对的形式存储数据,...

    JAVA操作cassandra数据库

    PreparedStatement ps = session.prepare("INSERT INTO table_name (column1, column2) VALUES (?, ?)"); BoundStatement bs = ps.bind(value1, value2); session.execute(bs); ``` 查询数据则类似: ```java ...

    windows下安装cassandra与C#访问配置

    using Apache.Cassandra; using System; public class Program { public static void Main(string[] args) { TTransport transport = new TFramedTransport(new TSocket("localhost", 9160)); TProtocol ...

    Cassandra数据模型

    - **超级列(Super Column)**:在较早版本的Cassandra中,超级列是列的集合,它有自己的名字,并且包含一组列。但现代版本的Cassandra已不再支持超级列,而是直接使用列族来存储多列数据。 2. **时间戳与版本控制...

    java NoSql Cassandra hector

    3. 定义Keyspace和ColumnFamily:Cassandra中的数据存储在Keyspace(类似数据库)和ColumnFamily(类似表)中。Hector提供了相应的API来定义它们。 ```java KeyspaceDef keyspaceDef = HFactory....

    Cassandra1.2

    在Cassandra 1.2 中,引入了超级列族(Super Column Family),允许在一个列族中组织更多的列,但后来在更高版本中被Composite Keys替代,以提供更好的查询性能。 ### 3. 数据复制 Cassandra 提供了数据复制功能,...

    Cassandra权威指南.pdf

    5. 超级行(Super Column):Cassandra中可选的高级数据类型,用于实现类似于关系型数据库中二级索引的功能。 Cassandra的查询语言称为CQL(Cassandra Query Language),它是类似于SQL的查询语句,用于与Cassandra...

    cassandra cli 命令 大全

    Cassandra CLI是Apache Cassandra数据库系统的一个命令行工具,它提供了与Cassandra集群交互的能力,包括连接到远程节点、创建或更新模式(schema)、设置和检索记录及列,以及查询节点和集群元数据。这个工具主要...

    cassandra入门demo

    **Cassandra 入门指南** Cassandra 是一个分布式NoSQL数据库系统,由Facebook开发并开源,现由Apache软件基金会管理。它设计用于处理大规模数据,提供了高可用性、线性可扩展性和强大的数据一致性。本篇文章将通过...

    Cassandra PHP操作类

    PHPcassa还支持批量操作,如`batch_insert`,以及条件查询、超级列(Super Columns,Cassandra早期版本的概念,现在已被SubColumns取代)等高级功能。此外,Cassandra的Thrift接口提供了丰富的API,允许进行复杂的...

    Cassandra的基础应用

    - **插入数据**:`INSERT INTO keyspace_name.table_name (column1, column2) VALUES (value1, value2);` - **查询数据**:`SELECT * FROM keyspace_name.table_name;` - **更新数据**:`UPDATE keyspace_name....

Global site tag (gtag.js) - Google Analytics