Created
January 11, 2018 13:09
-
-
Save zouzias/4c6b10d9eecab57269a83e2c9cb2c7b7 to your computer and use it in GitHub Desktop.
LuceneRDD Hello World
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Start Spark Shell using | |
// bin/spark-shell --packages org.zouzias:spark-lucenerdd_2.11:0.3.1 | |
// import required spark classes | |
import org.zouzias.spark.lucenerdd.LuceneRDD | |
import org.zouzias.spark.lucenerdd._ | |
// set the implicit value for sc (required by LuceneRDD) | |
implicit val sc = spark.sparkContext | |
val array = Array("Hello", "world") | |
val rdd = LuceneRDD(array) | |
val count = rdd.count | |
println("=" * 10) | |
println(s"LuceneRDD results count is ${count}") | |
println("=" * 10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment