title: Aggregate function in spark-sql not found
body: <p>I am new to Spark and I am trying to make use of some aggregate features, like sum or avg. My query in spark-shell works perfectly:</p>
  
  <pre><code>val somestats = pf.groupBy("name").agg(sum("days")).show()
  </code></pre>
  
  <p>When I try to run it from scala project it is not working thou, throwing an error messageé </p>
  
  <pre><code>not found: value sum
  </code></pre>
  
  <p>I have tried to add </p>
  
  <pre><code>import sqlContext.implicits._
  import org.apache.spark.SparkContext._
  </code></pre>
  
  <p>just before the command, but it does not help. My spark version is 1.4.1 Am I missing anything?</p>