随时间处理增量数据的Spark数据处理

问题描述

我的数据集列看起来像 date categorycol1 categorycol2 categorycol10 .. valuecol1 valuecol2 valuecol1000 .. valuecol1

现在,我每天都要记录一次数据流,该数据流每天都在作为文件夹排列的HDFS中流动。 因此,人们可以读取每个文件夹来获取当天的数据。

valuecol2device1是递增计数器,表示它们仅递增。为了获得合理的价值,我们必须获得一个增量。 例如,对于valuecol1,我们需要获取date2date1登录calculation1间的区别。

还计算新值,例如

difference between valuecol1 logged at date2 and date1 = difference between valuecol2 logged at date2 and date1 + mean

现在,最后,我们收集诸如stdmediajoin

之类的集合

问题:时间序列并不像股票行情自动收录器数据那样并置

以下操作会导致很多随机播放

  1. 使用date与数据集本身在不同的groubbykey进行连接以获取差异
  2. reducebykeyvoid main() { //this is an example like a json response List<Map<String,dynamic>> articleResponse = [ { "id":"1","name":"test1" },{ "id":"2","name":"test2" } ]; List<Article> articles = List<Article>.from(articleResponse.map((Map art)=>Article.fromJson(art))) .toList(); print('${articles.length} articles in the list!! use to render de ui list'); } class Article{ String id; String name; Article({this.id,this.name}); factory Article.fromJson(Map<String,dynamic> json) { return Article( id: json['id'],name: json['name'],); } } 用于获取有关cols类别的汇总

您能建议处理这种数据处理的最佳策略吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)