type
status
date
slug
summary
tags
category
icon
password
一、Spark 是什么?
- 核心定位:分布式大数据处理引擎(像超级厨房,多个厨师并行做饭)
- 核心优势:✅ 内存计算:比 MapReduce 快 100 倍(像用微波炉 vs 柴火灶)✅ 易用API:Python/Java/Scala/R/SQL 支持✅ 通用引擎:批处理、流计算、机器学习全支持
二、新手必知 3 大概念
概念 | 生活比喻 | 新手注意 |
SparkSession | 厨房总管👨🍳 | Shell 中已自动创建为 spark 变量 |
RDD | 生食材流水线🥬 | 底层 API,适合灵活操作 |
DataFrame | 预制菜套餐🍱 | 推荐新手使用!自带优化器 |
💡 惰性求值重点:Spark 像懒学生,不检查作业(Action)就不真学习(计算)!转换操作(如
filter
, select
):只记笔记行动操作(如 count
, show
):才交作业66三、手把手实战案例(Python 版)
场景:分析奶茶店订单(数据示例)
- Author:NotionNext
- URL:http://preview.tangly1024.com/article/252681d1-cc13-8004-bd9a-d52910406548
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!