网友收藏 文章浏览阅读569次。一、SparkContext、SparkConf内容回顾二、RDD创建的两种方式2.1、官网对于SparkConf的描述2.2、spark-submit的最佳实践三、使用idea构建SparkContext3.1、spark-shell查看命令帮助&&在客户端中使用3.2、此处涉及的参数调......
2024-01-23 23:07 阅读
阅读全文 网友收藏 文章浏览阅读142次。4. 缓存概要缓存的意义缓存相关的 API缓存级别以及最佳实践4.1. 缓存的意义使用缓存的原因 - 多次使用 RDD需求: 在日志文件中找到访问次数最少的 IP 和访问次数最多的 IPval conf = new SparkConf().setMaster("local[6......
2024-01-24 05:01 阅读
阅读全文 网友收藏 文章浏览阅读134次。DStreams 转换算子与RDD类似,转换允许修改来自输入DStream的数据。 DStreams支持普通Spark RDD上可用的许多转换。一些常见的如下。TransformationMeaningmap(func)Return a new DStream by passing each element of the source DStream through a ......
2024-01-23 10:31 阅读
阅读全文 网友收藏 文章浏览阅读459次。传递函数的场景当我自己封装好一个 RDD 的算子,需要使用,此时需要主要的是,初始化工作是在Driver 端进行的,而实际运行程序是在Executor端进行的,这就涉及到了跨进程通信,是需要把对象序列化的。封......
2024-01-23 03:51 阅读
阅读全文 网友收藏 文章浏览阅读1.1w次,点赞9次,收藏29次。第1关:转换算子之map和distinct算子import org.apache.spark.rdd.RDDimport org.apache.spark.{SparkConf, SparkContext}object EduCoder1 { def main(args: Array[String]): Unit = { val conf =new SparkConf().setAppName("educoder").se......
2024-01-21 11:52 阅读
阅读全文 网友收藏 文章浏览阅读798次。目录一.value类型1.map()2.mapPartitions()3.mapPartitionsWithIndex()4.flatMap()扁平化5.glom()6.groupBy()7.filter()8.sample()9. distinct()10.coalesce()11.repartition()12.sortBy()13. pipe()二、双value1.intersection()2.union()3.s..._with (index)...
2024-01-23 03:21 阅读
阅读全文 网友收藏 文章浏览阅读2.8k次,点赞4次,收藏3次。Spark闭包清理类ClosureCleaner简析 版权声明:本文为博主原创文章,未经博主允许不得转载。 手动码字不易,请大家尊重劳动成果,谢谢 作者:http://blog.csdn.net/wang_wbq从6月初开始因为......
2024-01-22 16:12 阅读
阅读全文 网友收藏 文章浏览阅读479次。RDD转换算子整体上分为:Value类型、双Value类型和Key-Value类型一.Value类型顾名思义是对单个value值进行运算的算子类型。下面主要从函数签名、功能、案例+图解三个方法介绍这几类算子。1.map():映射1)函数签......
2024-01-23 08:31 阅读
阅读全文 网友收藏 文章浏览阅读5.5k次,点赞7次,收藏49次。scala 系列spark 常用算子大全scala 常用算子大全scala 系列前言思维导图前言上一篇博客已经给大家介绍了 scala OOP, 掌握了OOP 的知识后,就已经算是进入 scala 的门了。scala OOP基础是 spark 和......
2024-01-23 10:53 阅读
阅读全文 网友收藏 文章浏览阅读455次。map是对每一个元素操作;mapPartitions是对其中的每个partition操作;mapPartitionsWithIndex:把每个partition中的分区号和对应的值拿出来,看源码:def mapPartitionsWithIndex[U](f : scala.Function2[scala.Int, scala.Iterator[T], scala.Ite..._......
2024-01-22 15:00 阅读
阅读全文