使用cassandra-cli创建复合键表 [英] create Composite-keyed Table with cassandra-cli

查看:417
本文介绍了使用cassandra-cli创建复合键表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用php为我的项目与phpcassa不支持cql,所以如果我理解,我必须编码cassandra命令像我将cassandra-cli。


我的问题是如何创建一个Composite-keyed表或动态列族,如网站,虽然不是用cql但是用cassandra-cli,我在哪里可以找到关于这种语言的更多信息。



解决方案

 创建列族myColumnFamily 
with key_validation_class ='CompositeType(UUIDType, UTF8Type)'
and comparator ='CompositeType(LongType,UTF8Type)'
and default_validation_class = UTF8Type



上述命令创建


  1. 一个名为 myColumnFamily 的列族

  2. 使用类型 UUID:String 的复合行键

  3. 对于复合列名称类型为 Long:String >
  4. 类型 String 的值


i want to use php for my project with phpcassa which doesn't support cql, so if I understood right I have to code cassandra commands like I would with cassandra-cli.

My question is how can I create a Composite-keyed Table or Dynamic Column Families like in this website, though not with cql but with cassandra-cli and where can I find more information about this language.

解决方案

create column family myColumnFamily
        with key_validation_class = 'CompositeType(UUIDType,UTF8Type)'
        and comparator = 'CompositeType(LongType,UTF8Type)'
        and default_validation_class = UTF8Type

The above command creates

  1. A column family named myColumnFamily
  2. With composite row key of type UUID:String
  3. With composite column name of type Long:String
  4. With value of type String

这篇关于使用cassandra-cli创建复合键表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆