title: To print output of SparkSQL to dataframe
body: <p>I'm currently running Analyze command for particular table and could see the statistics being printed in the Spark-Console</p>
  
  <p>However when I try to write the output to a DF I could not see the statistics.</p>
  
  <p><strong>Spark Version : 1.6.3</strong></p>
  
  <pre><code>val a : DataFrame = sqlContext.sql("ANALYZE TABLE sample PARTITION (company='aaa', market='aab', edate='2019-01-03', pdate='2019-01-10') COMPUTE STATISTICS").collect()
  </code></pre>
  
  <p><strong>Output in spark Shell</strong></p>
  
  <pre><code>    Partition sample{company=aaa, market=aab, etdate=2019-01-03, p=2019-01-10} stats: [numFiles=1, numRows=215, totalSize=7551, rawDataSize=461390]
  19/03/22 02:49:33 INFO Task: Partition sample{company=aaa, market=aab, edate=2019-01-03, pdate=2019-01-10} stats: [numFiles=1, numRows=215, totalSize=7551, rawDataSize=461390]
  </code></pre>
  
  <p><strong>Output of dataframe</strong></p>
  
  <pre><code>    19/03/22 02:49:33 INFO PerfLogger: &lt;/PERFLOG method=runTasks start=1553237373445 end=1553237373606 duration=161 from=org.apache.hadoop.hive.ql.Driver&gt;
  19/03/22 02:49:33 INFO PerfLogger: &lt;/PERFLOG method=Driver.execute start=1553237373445 end=1553237373606 duration=161 from=org.apache.hadoop.hive.ql.Driver&gt;
  19/03/22 02:49:33 INFO Driver: OK 
  19/03/22 02:49:40 INFO Executor: Running task 0.0 in stage 2.0 (TID 2)
  19/03/22 02:49:40 INFO Executor: Finished task 0.0 in stage 2.0 (TID 2). 940 bytes result sent to driver
  19/03/22 02:49:40 INFO TaskSetManager: Finished task 0.0 in stage 2.0 (TID 2) in 4 ms on localhost (1/1)
  19/03/22 02:49:40 INFO DAGScheduler: ResultStage 2 (show at &lt;console&gt;:47) finished in 0.004 s
  19/03/22 02:49:40 INFO TaskSchedulerImpl: Removed TaskSet 2.0, whose tasks have all completed, from pool
  19/03/22 02:49:40 INFO DAGScheduler: Job 2 finished: show at &lt;console&gt;:47, took 0.007774 s
  +------+
  |result|
  +------+
  +------+  
  </code></pre>
  
  <p>Could you please let me know how to get the same statistics output into the Dataframe.</p>
  
  <p>Thanks.!</p>