Git Product home page Git Product logo

spark-json's Introduction

Spark 对 JSON 的支持

大数据系统与大规模数据分析课程大作业,调研 Spark 对 JSON 数据格式的支持,主要测试了读取 JSON 文件、读取 Paraquet 文件、读取 MongoDB、各种 AP 操作。

快速上手

本文只介绍有关 Spark 的安装,Hadoop 和 MongoDB 请自行寻找安装教程。

1. 搭建 Spark

这里使用的是 Kubernetes 进行容器管理,然后使用 Spark Operator 来在 K8s 上运行 Spark 程序。

Kubernetes 安装教程:https://pipe.ccm.ink/archives/k8s

Spark Operator:https://github.com/GoogleCloudPlatform/spark-on-k8s-operator

2. 测试数据

测试数据生成程序保存在了 data 目录下,使用 Golang 编写,采用了 Go mod 进行包管理。

cd data
go run data

3. 运行 Spark

使用 k8s-application 目录下的 yaml 文件,运行对应的 Spark 程序。

# 启动程序
kubectl apply -f readfile.yaml

# 停止程序
kubectl delete -f readfile.yaml

运行成功后,即可看到 K8s 中有对应的 driver 和 executor 生成。

spark-application

4. 查看运行时间

根据自身 Spark Operator 的配置,访问 Spark 程序对应的分析页面,在页面中能够看到每个 Job、Stage、Task 的执行时间。

image

spark-json's People

Contributors

chen622 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.