title: Java Spark Dataset can select but cannot groupBy, filter or aggregate
body: <p>I want to do some rollup with my data using Java, by using Dataset/DataFrame of Java Spark-SQL. However, it throws an error:</p>
  <pre><code>Job aborted due to stage failure: Task serialization failed: java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.storage.StorageUtils$
  java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.storage.StorageUtils$
      at org.apache.spark.util.io.ChunkedByteBufferOutputStream.toChunkedByteBuffer(ChunkedByteBufferOutputStream.scala:118)
      at org.apache.spark.broadcast.TorrentBroadcast$.blockifyObject(TorrentBroadcast.scala:295)
      at org.apache.spark.broadcast.TorrentBroadcast.writeBlocks(TorrentBroadcast.scala:127)
      at org.apache.spark.broadcast.TorrentBroadcast.&lt;init&gt;(TorrentBroadcast.scala:88)
      at org.apache.spark.broadcast.TorrentBroadcastFactory.newBroadcast(TorrentBroadcastFactory.scala:34)
      at org.apache.spark.broadcast.BroadcastManager.newBroadcast(BroadcastManager.scala:62)
      at org.apache.spark.SparkContext.broadcast(SparkContext.scala:1489)
      at org.apache.spark.scheduler.DAGScheduler.submitMissingTasks(DAGScheduler.scala:1163)
      at org.apache.spark.scheduler.DAGScheduler.submitStage(DAGScheduler.scala:1071)
      at org.apache.spark.scheduler.DAGScheduler.handleJobSubmitted(DAGScheduler.scala:1014)
      at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:2069)
      at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:2061)
      at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:2050)
      at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:49)
  </code></pre>
  <p>My code is like this:</p>
  <pre><code>Dataset&lt;Row&gt; dataset = sparkSession.createDataFrame(rdd, MyPojo.class); // where rdd has type JavaRDD&lt;MyPojo&gt;
  dataset.collectAsList();
  </code></pre>
  <p>Why is it throwing this error?</p>