Apache Cassandra如何进行聚合操作? [英] How does Apache Cassandra do aggregate operations?

查看:741
本文介绍了Apache Cassandra如何进行聚合操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Apache Cassandra和nosql一般都很新。

I'm fairly new to Apache Cassandra and nosql in general.

在SQL中我可以执行如下的聚合操作:

In SQL I can do aggregate operations like:

SELECT 
  country, sum(age) / count(*) AS averageAge 
FROM people 
GROUP BY country;

这是很好的,因为它是在DB内计算,而不是移动

This is nice because it is calculated within the DB, rather than having to move every row in the 'people' table into the client layer to do the calculation.

在Apache Cassandra中这是可能的吗?如何?

Is this possible in Apache Cassandra? How?

推荐答案

Cassandra主要是一种支持快速写入和查找的机制。不支持像SQL中的聚合这样的计算,因为它不是为此而设计的。我建议阅读流行的Cassandra使用案例,以获得更好的洞察:)我已经在我美味的网页上加了一些文章。以下是链接:

Cassandra is primarily a mechanism that supports fast writes and look-ups. There is no support for calculations like aggregates in SQL since it is not designed for that. I would suggest reading of popular Cassandra use-cases to get a better insight :) I have bookmarked some articles on my delicious page. Here is the link:

http:// delicious。 com / vibhutesagar / cassandra

这篇关于Apache Cassandra如何进行聚合操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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