文章浏览阅读705次。Scala中的aggregate方法这个函数还是比较有意思的,在spark中也会常常用到一、首先举一个计算字符串内字符出现次数的例子://统计字母出现的频率映射def strfreq(str:String):mutable.Map[Char,Int]={ val strlist=str.toList //......
文章浏览阅读427次。基础初始化sparkval conf = new SparkConf().setAppName("wordcount")val sc = new SparkContext(conf)转化操作和行动操作的区别在于spark计算rdd的方式不同,只有在第一次在一个行动操作中用到转化操作中的rdd时,才......
文章浏览阅读386次。主要解释一下percentile_cont的计算方法:数据准备创建表:create table test( id integer, info text);alter table test owner to postgres;插入数据:INSERT INTO public.test (id, info) VALUES (1, 'test1');INSERT INTO public.test (id, info) VALUE......