在cassandra中选择不同计数的方法是什么?

问题描述 投票:1回答:1

我需要在cassandra的表中选择不同的计数。

据我所知,cassandra不支持直接非重复计数,甚至rdbms之类的嵌套查询也不支持。

select count(*) from (select distinct key_part_one from stackoverflow_composite) as count;

SyntaxException:行1:21在输入'('处没有可行的选择(从[[] ...中选择count(*)]

有什么方法得到它。我是否可以直接从cassandra或需要使用任何附加工具/语言?

下面是我的创建表语句。

CREATE TABLE nishant_ana.ais_profile_table (
    profile_key text,
    profile_id text,
    last_update_day date,
    last_transaction_timestamp timestamp,
    last_update_insertion_timestamp timeuuid,
    profile_data blob,
    PRIMARY KEY ((profile_key, profile_id), last_update_day)
) WITH CLUSTERING ORDER BY (last_update_day DESC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';

我刚刚开始使用cassandra。

database nosql datastax cassandra-3.0 datastax-enterprise-graph
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.