title: Saving as Text in Spark 1.30 using Dataframes in Scala
body: <p>I am using Spark version 1.3.0 and using dataframes with SparkSQL in Scala.  In version 1.2.0 there was a method called "saveAsText".  In version 1.3.0 using dataframes there is only a "save" method.  The default output is parquet.<br>
  <strong>How can I specify the output should be TEXT using the save method ?</strong></p>
  
  <pre><code>// sc is an existing SparkContext.
  val sqlContext = new org.apache.spark.sql.SQLContext(sc)
  // this is used to implicitly convert an RDD to a DataFrame.
  import sqlContext.implicits._
  
  // Define the schema using a case class.
  // Note: Case classes in Scala 2.10 can support only up to 22 fields. To work around this limit,
  // you can use custom classes that implement the Product interface.
  case class Person(name: String, age: Int)
  
  // Create an RDD of Person objects and register it as a table.
  val people = sc.textFile("examples/src/main/resources/people.txt").map(_.split(",")).map(p =&gt; Person(p(0), p(1).trim.toInt)).toDF()
  people.registerTempTable("people")
  
  // SQL statements can be run by using the sql methods provided by sqlContext.
  val teenagers = sqlContext.sql("SELECT name FROM people WHERE age &gt;= 13 AND age &lt;= 19")
  
  teenagers.save("/user/me/out")
  </code></pre>