Is it possible to run CQL3 queries “create table”, “insert into” with Astyanax?

痴心易碎 提交于 2020-01-17 14:06:38

问题


For now I have found just "select" examples.

Or is it possible to do with e.g. MutationBatch?

MutationBatch m = keyspace.prepareMutationBatch();
ColumnListMutation<String> cfmStandard = m.withRow(MY_CF, ...);

my column family is:

 CREATE TABLE my_cf (
                   ... key text,
                   ... timeid timeuuid,
                   ...   flag boolean,
                   ...   data text,
                   ... PRIMARY KEY (key, timeid));

回答1:


worked for inserts and create:

keyspace.prepareQuery(MY_CF).withCql(queryBuilder.toString()).execute();


来源:https://stackoverflow.com/questions/11952724/is-it-possible-to-run-cql3-queries-create-table-insert-into-with-astyanax

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!