Skip to content

Instantly share code, notes, and snippets.

takezoe / JavaDateTimeSerializers.scala
Last active November 13, 2019 14:41
Java8 Date & Time API support for json4s
View JavaDateTimeSerializers.scala
package org.scalatra.json
import java.time._
import java.util.{ Date, TimeZone }
import org.json4s._
import org.json4s.ext.DateParser
object JavaDateTimeSerializers {
mlehman / MultipleOutputsExample.scala
Last active April 11, 2022 06:54
Hadoop MultipleOutputs on Spark Example
View MultipleOutputsExample.scala
/* Example using MultipleOutputs to write a Spark RDD to multiples files.
Based on saveAsNewAPIHadoopFile implemented in org.apache.spark.rdd.PairRDDFunctions, org.apache.hadoop.mapreduce.SparkHadoopMapReduceUtil.
val values = sc.parallelize(List(
("fruit/items", "apple"),
("vegetable/items", "broccoli"),
("fruit/items", "pear"),
("fruit/items", "peach"),
("vegetable/items", "celery"),
("vegetable/items", "spinach")