title: Is there any way to get the output of Spark's Dataset.show() method as a string?
body: <p>The Spark <code>Dataset.show()</code> method is useful for seeing the contents of a dataset, particularly for debugging (it prints out a nicely-formatted table).  As far as I can tell, it only prints to the console, but it would be useful to be able to get this as a string.  For example, it would be nice to be able to write it to a log, or see it as the result of an expression when debugging with, say, IntelliJ.</p>
  
  <p>Is there any way to get the output of <code>Dataset.show()</code> as a string?</p>