kmry / Play-with-Spark

The easiest way to figure out how to connect Scala Play and Apache Spark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Play with Apache Spark

This is a simple example that combines Scala Play with Apache Spark.

Project's main purpose is to have a basic understanding on how to call Spark from Play. The class controllers.HomeController has two examples on how to call a function from spark.SparkTest that calls Apache Spark. The example creates an sequence of numbers as a DataSet, counts them and send this result to Scala Play. The count gets displayed by the browser using Play's HTML views.

The present project is an academic effort to indicate how to connect both technologies.

Run

To run the example, execute:

sbt run

Spark and SBT

The challeging part was to combine dependencies from different projects along with Spark, Scala and SBT versions. The result is something that works, but can be improved. Nevertheless, I can lived with all the versions used here.

The versions are:

  • Scala Play 2.6.12
  • SBT 1.1.1
  • Scala 2.11.8
  • Apache Spark 2.2.0

Acknowledgments

Special thanks to @playframework, @knoldus and @anubhav100. I was able to pull this through checking their repositories and code. Also, this project was mainly based on play-scala-rest-api-example

References

About

The easiest way to figure out how to connect Scala Play and Apache Spark

License:Other


Languages

Language:CSS 50.8%Language:Scala 40.5%Language:HTML 8.7%