embedded cassandra:如何应用脚本?

mepcadol  于 2021-06-15  发布在  Cassandra
关注(0)|答案(1)|浏览(370)

我想针对cassandra支持的数据访问层编写测试。因此,我将嵌入式cassandra与astyanax和cassandra单元一起使用,但我找不到将包含以下内容的脚本加载到嵌入式示例的方法:

create column family user_profiles
    with key_validation_class = UTF8Type
     and comparator = UTF8Type
     and column_metadata = [
       {column_name: first_name, validation_class: UTF8Type},
       {column_name: last_name, validation_class: UTF8Type},
       {column_name: email, validation_class: UTF8Type},
       {column_name: year_of_birth, validation_class: IntegerType}
     ]

有办法吗?如果我在脚本中切换到cql3,解决方案是否有效?

aelbi1ox

aelbi1ox1#

cassandra单元的最新版本(1.2.0.1)提供了您所需要的:cql3脚本集成。https://github.com/jsevellec/cassandra-unit/wiki/changelog

相关问题