title: How to create pipeline of functions in Spark that have to be applied on a dataset?
body: <p>I have one spark dataset <code>Dataset&lt;T&gt;</code> loaded from Cassandra Table, and I want to apply list of operations (chain or pipeline) on this dataset. </p>
  
  <p>For example:</p>
  
  <pre><code>Dataset&lt;T&gt; dataset= sparkSession.createDataset(javaFunctions(spark.sparkContext())
                      .cassandraTable(...));
  
  Dataset&lt;Row&gt; result = dataset.apply(func1()).apply(func2()).apply(func3());
  </code></pre>
  
  <p>func1() will replace null values with most frequent ones.</p>
  
  <p>func2() will add new columns with new values.</p>
  
  <p>func3() ....etc.</p>
  
  <p>What is the best way to apply this pipeline of functions?</p>