Giter VIP home page Giter VIP logo

spark-streaming-sample-app's Introduction

Parquet Streaming Application

This is a sample Scala application that demonstrates streaming data processing using Apache Spark and Spark's Structured Streaming API. The application reads streaming data, performs transformations, and writes the output in Parquet format.

Features

  • Generates streaming data
  • Writes the transformed data in Parquet format
  • Allows configuration of checkpoint path, output path, and processing time interval

Prerequisites

  • Java 8 from Amazon Corretto is installed
  • Apache Spark 2.4.7 is installed
  • Scala is installed
  • Maven is installed
  • SDKMAN! is installed (optional but recommended for managing Java and Spark versions)

Usage

  1. Clone this repository or download the source code.
  2. Ensure that Java 8 from Amazon Corretto and Apache Spark 2.4.7 are installed and configured properly.
  3. (Optional) Install SDKMAN! for easier management of Java and Spark versions. Use sdk env install to install the correct Java and Spark versions.
  4. Build the application using mvn clean package
  5. Run the MySparkApp application Command to run the MySparkApp application:
spark-submit --class org.github.kevinwallimann.sssa.MySparkApp <jar-file> --checkpoint <checkpoint-path> --output <output-path> --interval <processing-interval>

Example:

spark-submit --class org.github.kevinwallimann.sssa.MySparkApp target/spark-streaming-sample-app-0.1.0-SNAPSHOT.jar --checkpoint /tmp/sssa/checkpoints --output /tmp/sssa/out --interval "5 seconds"

Configuration

The MySparkApp application supports the following command-line options:

  • --checkpoint <checkpoint-path>: Specifies the checkpoint path for the streaming query.
  • --output <output-path>: Specifies the output path for writing Parquet files.
  • --interval <processing-interval>: Specifies the processing time interval for triggering Parquet writes (e.g., '5 seconds', '1 minute').

Acknowledgements

A large amount of this codebase was generated with chatGPT.

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.