Spark way to explore https:https://cdn.v2ex.com/navatar/e4bb/4c51/695_normal.png?m=1488326106 https:https://cdn.v2ex.com/navatar/e4bb/4c51/695_large.png?m=1488326106 2023-05-26T09:53:23Z Copyright © 2010-2018, V2EX 求助广大网友 tag:www.v2ex.com,2023-05-26:/t/943262 2023-05-26T09:53:23Z 2023-05-26T09:53:23Z tickwongcn member/tickwongcn get_json_object(regexp_replace(regexp_replace(regexp_replace(split(regexp_replace(content, "\":\"", "\"::\""), "::")(1), "\{"", "{"), ""\}", "}"), "\\", ""), "$.score")

有大佬知道如何转义为 spark sql 的格式?

]]>
真的深入了解开源项目是动手实现--《Spark Core 精简版》 tag:www.v2ex.com,2022-08-13:/t/872615 2022-08-13T06:46:43Z 2022-11-26T16:35:00Z winchang member/winchang 看了许利杰老师的
这本书,老师在理论层面讲的比较清楚了,读起来也容易理解,但看完但总是感觉还差点什么。于是动手起了个项目,定了个小目标:实现 RDD 的逻辑。

目前 RDD 的 MVP 已经完成,最大的收获是彻底理解了几个费解的问题:

1 ,Stage 的切分原理,为什么要这么做

2 ,Shuffle 是如何实现的,write/read 是如何衔接

3 ,Partition 为何如此的重要

有兴趣的同学一起 github 交个朋友吧,项目地址 https://github.com/changzhiwin/spark-core-analysis ,特点:

1 ,聚焦在 RDD 层面(这是 Spark 的根本)

2 ,入门明确,代码量小(保留逻辑),容易上手运行(运行起来,理解代码就容易了)

]]> 求助几个 Spark 问题 tag:www.v2ex.com,2022-06-29:/t/862897 2022-06-29T04:14:14Z 2022-06-29T04:12:14Z hitzhaowenqiang member/hitzhaowenqiang Q1: Someone handed you this dataset (~1GB), and you discovered that it’s over 1,000 tiny files. var df = spark.read.format("orc").load(clean_tracker_cstt_path) ○ Using Spark, please show how you can improve storage efficiency, and explain why this is important. ○ After improving storage efficiency, please explain impact on loading and using dataset in Spark.

Q2: Given the schema below, use Spark 2.x Dataframe API to give count of events per day for the last 7 days.

root |-- action_id: integer (nullable = true) |-- receive_time: timestamp (nullable = true) |-- uuid: string (nullable = true)

Q3: You have calculated the Daily Event Count above using Spark API. Now please find the Min, Max, Mean, and Standard Deviation of Daily Count by using Scala. Only built-in Scala functions may be used. Please format the answer with 2 decimal places, e.g. “The Average Daily Count from Last 7 Days is x.xx”.

]]>
spark 做内容推荐,希望大佬给一些思路上的指导 tag:www.v2ex.com,2022-03-02:/t/837514 2022-03-02T10:21:56Z 2022-03-02T10:21:56Z laobaozi member/laobaozi
目前使用 spark 做 demo 实现如下:

1. submit 应用时传递用户 id

2. 将该用户的最后阅读的 5 篇文章合并为一条长内容

3. 获取最新的 500 篇文章

4. 用长内容与最新的 500 条生成一个 DateFrame 做余弦相似度计算,得到最相似的 topN

5. 定时或者实时触发 submit

虽然能跑,但是总感觉哪里不对。同时对如何实现批量为户计算推荐内容也没有好思路,难道传用户 id 数组然后是循环跑上述流程吗 ]]>
有没有不错的 SparkStreaming+Kafka 的开源项目可以用来入门和进阶? tag:www.v2ex.com,2021-12-29:/t/825121 2021-12-29T09:12:52Z 2021-12-29T09:12:52Z depress member/depress Spark 解析复杂 xml,数据如何映射到多表中 tag:www.v2ex.com,2021-09-01:/t/799307 2021-09-01T09:29:51Z 2021-09-01T10:28:51Z bluehtt member/bluehtt 需求:利用 Spark 解析 xml 文件,xml 结构最大深度有 8 层,数据有复杂的关联关系,处理后会插入到 20 多张表中。由于使用工具解析后的 DataFrame 结构过长,简单截取了一部分如下:

simple dataFrame

目前没有好的思路,就是获取每一列元素依次遍历提取出所有需要的元素,但是想到要遍历 8 层眼泪都要流下来了:

// 层层对象遍历 val identifiers = row.get(0).asInstanceOf[Row].get(0).asInstanceOf[Row].get(0).asInstanceOf[Row].get(0) // 解析数组 println(identifiers.asInstanceOf[mutable.WrappedArray[AnyRef]](0)) 

就以图示中的结构来说,数据不算复杂,但是完整的结构实在是令人神伤,贴了图恐怕会占据整个页面。另外最终要插入的 20 多张表中十几张是关联表。 初次使用 Spark 处理数据,求大家给点意见和思路,万分感谢!

]]>
spark 大数据离线分析 爬虫存到 csv 有的列是长度不固定的 list 请问应该怎么存到 hive?直接存 list 吗?该怎么分析呢? tag:www.v2ex.com,2021-04-08:/t/769217 2021-04-08T13:50:59Z 2021-09-04T15:36:03Z txc106 member/txc106 完全没有头绪 另目前自己定的流程是爬虫-》 hdfs-》通过 scala 预处理后存 hive-》 scala 分析-》 mysql-》可视化 请问这个流程有什么问题吗? 看其他项目处理的数据都没有 list 我是因为那列有的是空有的有三四个数据 然后就直接存的 list 该怎么处理呢?我也没能查到其他人有类似的处理流程。。。

]]>
PayPal 招 资深大数据工程师 啦 - 技术栈: Spark, Scala, Java , Python 等 tag:www.v2ex.com,2020-10-27:/t/719033 2020-10-27T06:27:12Z 2020-10-27T06:38:46Z MPAmber member/MPAmber 加入 PayPal 是什么样的体验?

• 轻松愉快的工作氛围,众多优秀以及 nice 的小伙伴 • 超长的假期 —— 每年 15 天年假起,每工作满 1 年加一天(最多 20 天);除此以外,工作满 5 年还将获得额外的 4 周带薪假期!以及 15 天带薪病假等等等。 • 包容、多元以及国际化的公司文化 • 市值 2000 亿美元,全民持股,股票激励,薪酬不输 996 公司的“福报”。work-life balance,生活不应只有加班。

PayPal 的大数据组会做什么?

At PayPal Global Data Science(GDS) team, we develop machine learning platform and AI applications to improve PayPal’s global business. Machine learning and AI is one of the core competitive advantage of PayPal, which significantly reduced payment risk loss, brought million dollars’ revenue and expanded to multiple domains rapidly. As an engineer in GDS, you will work closely with analytical team, understand the requirement with cutting-edge algorithm, contribute to the core platform, make the research work to a real product. We are looking for strong technologists who are passionate to solve machine learning problems and able to continuously deliver AI solutions in scalable way.

这个职位的要求是什么?

Qualifications • BS, MS, or PhD in Computer Science or related technical discipline (or equivalent). • 8+ years’ work experience in software development area with at least 5+ years’ experience in Java programming. • Excellent understanding of computer science fundamentals, data structures, and algorithms. • Excellent problem solving skills, can triage and resolve critical tech issues without supervision. • Expertise required in object-oriented design methodology and application development in Java. • Experience in big data technology such as Hadoop/Spark/Pig/HBASE/Streaming • Mastering at least one scripting language such as Unix Shell/Python/Perl/JS • Hands on web application development skill (HTML5/CSS/JS) is a very big plus • Knowledge on Machine Learning application pipeline is a very big plus • Proven results oriented person with a delivery focus in a high velocity, high quality environment. • Strong communication skills in Oral and Written English. • Working Experience in Multi-national Company is a plus. • Geek style is a big plus.

还有附加!!!!!!!!:

如果有兴趣的小伙伴,同时又有点担心年终奖的损失的话。 不用担心!基于面试情况,PayPal 会考虑给予额外奖金或者 Sign-On Bonus 之类减少你的年终奖损失, 让你在年底既能轻松搞定新的 Exciting 的工作机会,又能即时得到一些补偿,何乐不为呢?

]]>
关于 Spark Task 的疑问 tag:www.v2ex.com,2020-08-04:/t/695639 2020-08-04T13:12:30Z 2020-08-04T18:01:22Z starry97 member/starry97 avatar

关于上面那个图,ShuffleMapStage 中,有三个 RDD,每个 RDD 有三个分区 我看网上文章都是说一个分区对应一个 task,

1.上面那个 ShuffleMapStage 中阶段里是否存在 9 个 Task 。

2.但站在 pipeline 角度上看,应该只有三个 task,每个 RDD 的一个分区组合成一个 task 。

上面两种说法,哪种是正确的呢,被搞糊涂了。谢谢!

]]>
有没有在滴滴或者其他网约车公司的同学,请教一个数据量的问题 tag:www.v2ex.com,2020-05-29:/t/676825 2020-05-29T13:10:52Z 2020-05-30T05:14:27Z sodadev member/sodadev 一台车子如果早上 9 点开始接单 10 个小时会产生多少数据量呢,这些数据量分别都包含什么信息,谢谢解答!

]]>
spark 作业求助,剔除空值大于三的行 tag:www.v2ex.com,2020-05-22:/t/674431 2020-05-22T08:30:10Z 2020-05-22T08:27:10Z qianxaingmoli member/qianxaingmoli 将缺失值大于 n ( n=3 )个的数据条目剔除出原始数据集,并输出剔除的条目数量;

有没有大佬能说下 scala 的写法,rdd 处理完多行会挤在一起了,dataframe 写了又不太对

]]>
spark 有用 kotlin 写代码的吗? tag:www.v2ex.com,2020-04-28:/t/666936 2020-04-28T07:19:29Z 2020-06-30T12:43:26Z muziling member/muziling 看了官方好像支持 scala,不支持 kotlin,不知道用 kotlin 方不方便, scala 没学过。

]]>
现在写 spark 程序,都是用 scala 吗 tag:www.v2ex.com,2020-04-20:/t/664357 2020-04-20T09:25:25Z 2020-04-20T09:25:25Z muziling member/muziling spark,kotlin 不被官方支持吗,kotlin 好学, scala 感觉入门不易。

]]>
spark 核心构件之 Dependency 宽窄依赖 tag:www.v2ex.com,2019-03-23:/t/547675 2019-03-23T04:34:22Z 2019-03-23T04:31:22Z rootzeal member/rootzeal https://mp.weixin.qq.com/s/QmceOaI7aP1YAmyec-IpmA
spark 作者的抽象能力和架构能力 真牛 B ]]>
spark 内存管理的实现 tag:www.v2ex.com,2019-01-29:/t/531704 2019-01-29T13:04:23Z 2019-01-29T13:01:23Z rootzeal member/rootzeal https://mp.weixin.qq.com/s/4TqxXO0D8svoZTwBSKfqEQ ]]> spark 源码研究 tag:www.v2ex.com,2019-01-28:/t/531352 2019-01-28T11:55:28Z 2019-01-28T12:25:12Z rootzeal member/rootzeal https://mp.weixin.qq.com/s/rjrpRZWj2pyscPHOMF1QCQ ]]> spark straming。submit Python 脚本报错。 tag:www.v2ex.com,2017-11-24:/t/409151 2017-11-24T03:11:55Z 2017-11-24T03:08:55Z yanzixuan member/yanzixuan spark 2.2.0 默认安装,啥都没动 python 2.7.9 ipython 5.4.1 运行 network_wordcount 例子。 跑 scala 脚本成功,但是运行 python 的例子,直接报错: Job aborted due to stage failure: Task 0 in stage 2.0 failed 1 times, most recent failure: Lost task 0.0 in stage 2.0 (TID 1, localhost, executor driver): java.lang.IllegalArgumentException: port out of range:459092027

自己去谷歌了一下,这个 bug 被提交过: https://issues.apache.org/jira/browse/SPARK-7688

但是被认为不是 bug,直接关掉了 怎么解决的没说。 有达人知道怎么搞么?

]]>
CPython, PyPy 和 Scala 在 Spark 平台上的性能对比 tag:www.v2ex.com,2017-02-28:/t/343942 2017-02-28T22:18:40Z 2017-03-01T01:06:46Z Livid member/Livid http://emptypipes.org/2015/01/17/python-vs-scala-vs-spark/

TLDR: PyPy 很靠谱,现在的新版本就更赞了。 ]]>
Spark/Scala 的细节讨论:在 map task 里的 map 会得到如何的处理? tag:www.v2ex.com,2016-09-14:/t/306340 2016-09-14T14:26:15Z 2016-09-14T14:36:27Z alexapollo member/alexapollo 按观察看,是都不会生成新的 map task 的,纯粹的本地执行,但哪儿有对应的说明呢?

]]>
SPARK 文档查询好费劲 tag:www.v2ex.com,2016-07-23:/t/294408 2016-07-23T08:56:07Z 2016-07-23T10:50:29Z jaymiao member/jaymiao http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.package 在 spark 官方文档上查询函数好费劲.一级筛选只能以 package 为关键词,如果不知道一个函数是哪个 package 的,就无法进行搜索。比如 predict 函数,只能是先搜索 Predict 包然后下面才有 predict 函数。

大家有啥好方法进行 spark 的方法搜索么。

]]>
Apache Spark 之间的共享项目配置文件问题 tag:www.v2ex.com,2016-06-24:/t/288072 2016-06-24T08:31:56Z 2016-06-26T13:39:02Z qfdk member/qfdk 最近做大数据的项目,碰到了一个坑, Running on yarn 的时候有两个模式,一个是 client 一个是 cluster , 但是我的 Big jar 里面需要读 取配置文件配置文件在本地,所用用 cluster 模式会出现 FilenotfondException , excutor 不知道这个文件的位置,现在想让excutor 知道这个文件的位置和内容

找到了几个参数 就是 spark-submit 加上--files 但是似乎没有起到作用,求个正确的姿势。 有两个配置文件,一个是 project.propeties , 一个是 parser.properties 用 Scala 搞得,但是 io 只能读取本地文件,这个比较坑,因为 hadoop 上面的文件系统似乎和本地的不一样。

还有一个方法似乎是用 --properties-file 但是这个只能载入配置。来个正确的姿势急等。*

spark-submit --class "app.Runml" --master yarn-cluster --files "/home/expertise/BigData2016/conf/project.properties","/home/expertise/BigData2016/conf/2016.properties" --jar ~/BigData2016/ml-assembly-1.0.jar 出现了 FileNotFond ,但是 client 模式就 ok 。 郁闷死了,不想重新改 parser 的代码,这里是读取文件的代码,返回一个 properties ,可以之间 properties.get(你想要的参数)

object Tools { def conf(file: String): Properties = { val properties = new Properties() properties.load(new FileInputStream(file)) properties } } 
]]>
疑问:spark对于迭代运算场景很有优势,那对于迭代不严重的计算场景呢? tag:www.v2ex.com,2014-01-02:/t/95416 2014-01-02T12:10:30Z 2014-09-29T22:24:46Z xiaochong member/xiaochong
还有就是除了文档里面机器学习的几个算法,大家在日常还有哪些比较合适的应用场景,以及集群的规模(cpu个数,内存数),希望大家分享。 ]]>
First Steps with Spark – Screencast #1 tag:www.v2ex.com,2013-06-02:/t/71004 2013-06-02T16:00:37Z 2013-06-02T16:00:37Z fsw90628 member/fsw90628
把数据放到内存里处理当然会快很多,只是,要多大的内存才够呢? ]]>
ubao snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86