code: public static void writeWritablesToFile(String outputPath, String delim, List<List<Writable>> writables,
                      JavaSparkContext sc) throws IOException {
          StringBuilder sb = new StringBuilder();
          for (List<Writable> list : writables) {
              boolean first = true;
              for (Writable w : list) {
                  if (!first)
                      sb.append(delim);
                  sb.append(w.toString());
                  first = false;
              }
              sb.append("\n");
          }
          writeStringToFile(outputPath, sb.toString(), sc);
      }
docs: Wlite a set of writables (or, sequence) to HDFS (or, locally).
  
  @param outputPath    Path to write the outptu
  @param delim         Delimiter
  @param writables     data to write
  @param sc            Spark context