/*
 * Copyright 2015 Sanford Ryza, Uri Laserson, Sean Owen and Joshua Wills
 *
 * See LICENSE file for further information.
 */

package com.cloudera.datascience

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

object MyApp {
  def main(args: Array[String]) {
    val sc = new SparkContext(new SparkConf().setAppName("My App"))
    println("num lines: " + countLines(sc, args(0)))
  }

  def countLines(sc: SparkContext, path: String): Long = {
    sc.textFile(path).count()
  }
}


/*
 * Copyright 2015 Sanford Ryza, Uri Laserson, Sean Owen and Joshua Wills
 *
 * See LICENSE file for further information.
 */

package com.cloudera.datascience

object MyApp {
  def main(args: Array[String]) {
    val sc = new SparkContext(new SparkConf().setAppName("My App"))
    println("num lines: " + sc.countLines(args(0)))
  }

  def countLines(sc: SparkContext, path: String): Long = {
    sc.textFile(path).count()
  }
}


--- 
+++ 
@@ -6,10 +6,13 @@
 
 package com.cloudera.datascience
 
+import org.apache.spark.SparkConf
+import org.apache.spark.SparkContext
+
 object MyApp {
   def main(args: Array[String]) {
     val sc = new SparkContext(new SparkConf().setAppName("My App"))
-    println("num lines: " + sc.countLines(args(0)))
+    println("num lines: " + countLines(sc, args(0)))
   }
 
   def countLines(sc: SparkContext, path: String): Long = {
Make simple spark project code compile
