Serverless for Apache Spark 概览

Google Cloud 借助 Serverless for Apache Spark,您无需预配和管理自己的 Dataproc 集群,即可运行 Spark 工作负载。您可以通过两种方式运行 Serverless for Apache Spark 工作负载: 批处理工作负载和交互式会话。

批处理工作负载

使用 Google Cloud 控制台、Google Cloud CLI 或 Dataproc API 向 Serverless for Apache Spark 服务提交批处理工作负载。该服务 将在托管式计算基础架构上运行工作负载,并根据需要自动扩缩资源 。Serverless for Apache Spark 费用仅在执行工作负载时 产生。

批处理工作负载功能

您可以运行以下 Serverless for Apache Spark 批处理工作负载类型:

  • PySpark
  • Spark SQL
  • Spark R
  • Spark(Java 或 Scala)

您可以在提交 Serverless for Apache Spark 批处理工作负载时指定 Spark 属性

安排批处理工作负载

您可以在 Airflow或使用 Airflow 批处理运算符Cloud Composer 工作流中安排 Spark 批处理工作负载。 如需了解详情,请参阅 使用 Cloud Composer 运行 Serverless for Apache Spark 工作负载

开始使用

如需开始使用,请参阅 运行 Apache Spark 批处理工作负载

交互式会话

在 Serverless for Apache Spark 交互式会话期间,在 Jupyter 笔记本中编写和运行代码。您可以通过以下 方式创建笔记本会话:

  • 在 BigQuery Studio 笔记本中运行 PySpark 代码。 打开 BigQuery Python 笔记本,以创建 基于 Spark Connect 的 Serverless for Apache Spark 交互式会话。每个 BigQuery 笔记本只能有一个与之关联的活跃 Serverless for Apache Spark 会话。

  • 使用 Dataproc JupyterLab 插件 根据您创建 和管理的模板创建多个 Jupyter 笔记本会话。在本地机器或 Compute Engine 虚拟机上安装该插件后,JupyterLab 启动器页面上会显示与不同 Spark 内核配置 对应的不同卡片。点击卡片以创建 Serverless for Apache Spark 笔记本会话,然后在笔记本中开始编写和测试代码。

    借助 Dataproc JupyterLab 插件,您还可以 使用 JupyterLab 启动器页面执行以下操作:

    • 创建 Dataproc on Compute Engine 集群。
    • 将作业提交到 Dataproc on Compute Engine 集群。
    • 查看 Google Cloud 和 Spark 日志。

安全合规性

Serverless for Apache Spark 遵循 Dataproc 遵守的所有 数据驻留CMEKVPC-SC 和其他安全要求。