-
-
Save Yuichiroh/75e7100ac938e6cdd534 to your computer and use it in GitHub Desktop.
This file contains 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
import org.apache.spark.SparkContext | |
import org.apache.spark.SparkContext._ //implicit conversion用 このソースでは使っていないけど書いておくといい | |
import org.apache.spark.SparkConf | |
object SampleApp { | |
def main(args: Array[String]) { | |
val srcFileName = "/work/data/something.gz" | |
val conf = new SparkConf().setAppName("SampleApp") | |
val sc = new SparkContext(conf) | |
val src = sc.textFile(srcFileName).cache() | |
val lines = src.count() | |
println("Lines %,d".format(lines)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment