title: spark sbt error: value toDF is not a member of Seq[DataRow]
body: <p>I have some spark scala code that works without an issue in spark-shell. </p>
  
  <p>The core of this issue lies on these few lines. I want to add an additional line to a dataframe:</p>
  
  <pre class="lang-scala prettyprint-override"><code>object SparkPipeline {
  
    def main(args: Array[String]) {
      val spark = (SparkSession
          .builder()
          .appName("SparkPipeline")
          .getOrCreate()
          )
  
      df = (spark
          .read
          .format("com.databricks.spark.avro")
          .load(DATA_PATH)
          )
  
      case class DataRow(field1: String, field2: String)
      val row_df = Seq(DataRow("FOO", "BAR")).toDF()  // THIS FAILS
      val df_augmented = df.union(row_df)
      //
      // Additional code here
      //
    }
  }
  </code></pre>
  
  <p>However, when I use sbt to package it as a jar, sbt fails with the following error : </p>
  
  <pre><code>value toDF is not a member of Seq[DataRow]
  </code></pre>
  
  <p>I tried as per <a href="https://stackoverflow.com/questions/36055774/value-todf-is-not-a-member-of-org-apache-spark-rdd-rdd">this question</a> to do: </p>
  
  <pre class="lang-scala prettyprint-override"><code>val spark = (SparkSession
      .builder()
      .appName("TrainSimpleRF")
      .getOrCreate()
      )
  
  val sc = spark.sparkContext
  val sqlContext= new org.apache.spark.sql.SQLContext(sc)
  import sqlContext.implicits._
  </code></pre>
  
  <p>Which does not fix the issue. Also tried importing <code>spark.implicits_</code> to no avail. I have all the code in the main method. I think that might matters( as per some answers in cloudera forums) but haven't managed to make it work regardless of how I structure the code.</p>
  
  <p>How do I make it work? Any help would be more than welcome. </p>