title: How do I print out a spark.sql object?
body: <p>I have a spark.sql object that includes a couple of variables.</p>
  
  <pre><code>import com.github.nscala_time.time.Imports.LocalDate
  
  val first_date = new LocalDate(2020, 4, 1)
  val second_date = new LocalDate(2020, 4, 7)
  
  val mydf = spark.sql(s"""
          select *
          from tempView
          where timestamp between '{0}' and '{1}'
  """.format(start_date.toString, end_date.toString))
  </code></pre>
  
  <p>I want to print out <code>mydf</code> because I ran <code>mydf.count</code> and got 0 as the outcome.</p>
  
  <p>I ran <code>mydf</code> and got back <code>mydf: org.apache.spark.sql.DataFrame = [column: type]</code> </p>
  
  <p>I also tried <code>println(mydf)</code> and it didn't return the query.</p>
  
  <p>There is this related <a href="https://stackoverflow.com/questions/56033068/spark-how-to-print-the-query">question</a>, but it does not have the answer.</p>
  
  <p>How can I print out the query?</p>