title: How to write dataframe (obtained from hive table) into hadoop SequenceFile and RCFile?
body: <p>I am able to write it into</p>
  <ul>
  <li><p><code>ORC</code></p>
  </li>
  <li><p><code>PARQUET</code></p>
  <p>directly and</p>
  </li>
  <li><p><code>TEXTFILE</code></p>
  </li>
  <li><p><code>AVRO</code></p>
  </li>
  </ul>
  <p>using additional dependencies from databricks.</p>
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.databricks&lt;/groupId&gt;
          &lt;artifactId&gt;spark-csv_2.10&lt;/artifactId&gt;
          &lt;version&gt;1.5.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.databricks&lt;/groupId&gt;
          &lt;artifactId&gt;spark-avro_2.10&lt;/artifactId&gt;
          &lt;version&gt;2.0.1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  <p>Sample code:</p>
  <pre><code>    SparkContext sc = new SparkContext(conf);
      HiveContext hc = new HiveContext(sc);
      DataFrame df = hc.table(hiveTableName);
      df.printSchema();
      DataFrameWriter writer = df.repartition(1).write();
  
      if (&quot;ORC&quot;.equalsIgnoreCase(hdfsFileFormat)) {
          writer.orc(outputHdfsFile);
  
      } else if (&quot;PARQUET&quot;.equalsIgnoreCase(hdfsFileFormat)) {
          writer.parquet(outputHdfsFile);
  
      } else if (&quot;TEXTFILE&quot;.equalsIgnoreCase(hdfsFileFormat)) {
          writer.format(&quot;com.databricks.spark.csv&quot;).option(&quot;header&quot;, &quot;true&quot;).save(outputHdfsFile);
  
      } else if (&quot;AVRO&quot;.equalsIgnoreCase(hdfsFileFormat)) {
          writer.format(&quot;com.databricks.spark.avro&quot;).save(outputHdfsFile);
      }
  </code></pre>
  <p>Is there any way to write dataframe into hadoop SequenceFile and RCFile?</p>