Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sanni Heruwala sanniheruwala

🏠
Working from home
  • Bangalore,IND
View GitHub Profile
@yoyama
yoyama / Schema2CaseClass.scala
Created Jan 20, 2017
Generate case class from spark DataFrame/Dataset schema.
View Schema2CaseClass.scala
/**
* Generate Case class from DataFrame.schema
*
* val df:DataFrame = ...
*
* val s2cc = new Schema2CaseClass
* import s2cc.implicit._
*
* println(s2cc.schemaToCaseClass(df.schema, "MyClass"))
*
@fancellu
fancellu / ConsumerExample.scala
Last active Jun 10, 2021
Kafka Producer/Consumer Example in Scala
View ConsumerExample.scala
import java.util
import org.apache.kafka.clients.consumer.KafkaConsumer
import scala.collection.JavaConverters._
object ConsumerExample extends App {
import java.util.Properties