Skip to content

Instantly share code, notes, and snippets.

View mtranter's full-sized avatar

Mark Tranter mtranter

View GitHub Profile
@mtranter
mtranter / expr.scala
Created May 29, 2018 23:09 — forked from calincru/expr.scala
Expression problem in Scala
// The expression problem is a new name for an old problem. The goal is to
// define a datatype by cases, where one can add new cases to the datatype and
// new functions over the datatype, without recompiling existing code, and while
// retaining static type safety (e.g., no casts).
// (Philip Wadler)
import scala.language.implicitConversions
object ExpressionProblem extends App {
@mtranter
mtranter / AvroDeserializationSchema.java
Created July 25, 2016 19:06
Avro deserializer for Flink's Data Stream API Kafka Source
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.DatumReader;
import org.apache.avro.io.DecoderFactory;
import org.apache.avro.reflect.ReflectDatumReader;
import org.apache.avro.specific.SpecificDatumReader;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.typeutils.TypeExtractor;
public class AvroDeserializationSchema<T> implements DeserializationSchema<T> {