有什么办法聚合表的数据在cassandra 2.1.6? [英] Is there any way to aggregate table's data in cassandra 2.1.6?

查看:217
本文介绍了有什么办法聚合表的数据在cassandra 2.1.6?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Cassandra的新人。我想汇总我的列如 SUM() MAX()等。

$ b $

解决方案

有什么方法可以帮助我?



因此,为了在Cassandra中进行聚合,有以下几个选项:

/ p>


  1. 执行一个查询,返回所有要聚合的行,并在客户端对它们进行求和,在java / python / etc


  2. 写入您的应用程序以在将数据插入Cassandra时执行数据汇总,并在插入其他数据时更新聚合数据。

    / li>
  3. 使用Cassandra Spark连接器将Cassandra与Apache spark等组件配对。


  4. 升级到Cassandra 2.2.0(目前可用作发布候选版本1)。 2.2中的新功能支持用户定义的函数。使用UDF,您可以定义聚合函数。请参阅此处的示例。



I am new in Cassandra. I want to aggregate my columns like SUM(), MAX(), etc.

So is there any way like functions or query or something that can help me ?

解决方案

The CQL (Cassandra Query Language) built into Cassandra 2.1.6 only supports the count() aggregation function.

So to do aggregation in Cassandra, there are a few options:

  1. Do a query that returns all the rows you want to aggregate, and sum them on the client side in java/python/etc.

  2. Write your application to do aggregation of your data when inserting it into Cassandra, and update the aggregated data as you insert additional data.

  3. Pair Cassandra with a component like Apache spark using the Cassandra Spark Connector. This requires some effort to learn and set up, but offers aggregation functions and many additional analytics features.

  4. Upgrade to Cassandra 2.2.0 (currently available as release candidate 1). A new feature in 2.2 is support for user defined functions. With UDF you can define aggregation functions. See an example here.

这篇关于有什么办法聚合表的数据在cassandra 2.1.6?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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