【问题标题】:Take count of distinct rows in a particular column of key space in cassandra计算 cassandra 中特定键空间列中的不同行
【发布时间】:2018-05-08 00:26:12
【问题描述】:

我需要计算Cassandra 中键空间 user_rating 的特定列“content_id'”中不同行的计数。我使用了两个查询,但出现如下错误:

SyntaxException:第 1:32 行在输入 ')' 处没有可行的替代方案(SELECT DISTINCT(COUNT([content_id])...)

我尝试的查询是:

1.  `cqlsh:recommendation_engine> SELECT DISTINCT(COUNT(content_id)) FROM user_rating;`   
2.  `select count (distinct content_id) from user_rating ;`

【问题讨论】:

    标签: cassandra


    【解决方案1】:

    您无法在 CQL 中执行此操作 - 请查看 CQL 的 SELECT syntax definition

    我建议使用 Spark 之类的东西来进行“复杂的数据处理”...

    【讨论】:

      猜你喜欢
      • 2012-01-03
      • 2014-05-04
      • 2015-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-16
      • 2017-02-01
      • 1970-01-01
      • 2016-05-15
      相关资源
      最近更新 更多