All Projects → hamba → Avro

hamba / Avro

Licence: mit
A fast Go Avro codec

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Avro

Open Bank Mark
A bank simulation application using mainly Clojure, which can be used to end-to-end test and show some graphs.
Stars: ✭ 81 (-38.64%)
Mutual labels:  avro
Screen Recorder Ffmpeg Cpp
*Multimedia project* A screen recording application to capture your desktop and store in a video format. Click here to watch the demo
Stars: ✭ 98 (-25.76%)
Mutual labels:  encoder-decoder
Karkinos
Penetration Testing and Hacking CTF's Swiss Army Knife with: Reverse Shell Handling - Encoding/Decoding - Encryption/Decryption - Cracking Hashes / Hashing
Stars: ✭ 115 (-12.88%)
Mutual labels:  encoder-decoder
Rnn pytorch
Using the Pytorch to build an image temporal prediction model of the encoder-forecaster structure, ConvGRU kernel & ConvLSTM kernel
Stars: ✭ 83 (-37.12%)
Mutual labels:  encoder-decoder
Magnolify
A collection of Magnolia add-on modules
Stars: ✭ 81 (-38.64%)
Mutual labels:  avro
Schema Registry
Confluent Schema Registry for Kafka
Stars: ✭ 1,647 (+1147.73%)
Mutual labels:  avro
Quick Screen Recorder
Lightweight desktop screen recorder for Windows.
Stars: ✭ 80 (-39.39%)
Mutual labels:  encoder-decoder
Abstractive Summarization
Implementation of abstractive summarization using LSTM in the encoder-decoder architecture with local attention.
Stars: ✭ 128 (-3.03%)
Mutual labels:  encoder-decoder
Schemer
Schema registry for CSV, TSV, JSON, AVRO and Parquet schema. Supports schema inference and GraphQL API.
Stars: ✭ 97 (-26.52%)
Mutual labels:  avro
A Pytorch Tutorial To Image Captioning
Show, Attend, and Tell | a PyTorch Tutorial to Image Captioning
Stars: ✭ 1,867 (+1314.39%)
Mutual labels:  encoder-decoder
Bigdata File Viewer
A cross-platform (Windows, MAC, Linux) desktop application to view common bigdata binary format like Parquet, ORC, AVRO, etc. Support local file system, HDFS, AWS S3, Azure Blob Storage ,etc.
Stars: ✭ 86 (-34.85%)
Mutual labels:  avro
Kaufmann ex
Kafka backed service library.
Stars: ✭ 86 (-34.85%)
Mutual labels:  avro
Avro Hadoop Starter
Example MapReduce jobs in Java, Hive, Pig, and Hadoop Streaming that work on Avro data.
Stars: ✭ 110 (-16.67%)
Mutual labels:  avro
Deeplab v3 plus
This is an ongoing re-implementation of DeepLab_v3_plus on pytorch which is trained on VOC2012 and use ResNet101 for backbone.
Stars: ✭ 83 (-37.12%)
Mutual labels:  encoder-decoder
Deepharmonization
Demo code of the paper: "Deep Image Harmonization", Y.-H. Tsai, X. Shen, Z. Lin, K. Sunkavalli, X. Lu and M.-H. Yang, CVPR 2017
Stars: ✭ 120 (-9.09%)
Mutual labels:  encoder-decoder
Avro Builder
Ruby DSL to create Avro schemas
Stars: ✭ 82 (-37.88%)
Mutual labels:  avro
Schema Registry
A CLI and Go client for Kafka Schema Registry
Stars: ✭ 105 (-20.45%)
Mutual labels:  avro
Abris
Avro SerDe for Apache Spark structured APIs.
Stars: ✭ 130 (-1.52%)
Mutual labels:  avro
Slimmessagebus
Lightweight message bus interface for .NET (pub/sub and request-response) with transport plugins for popular message brokers.
Stars: ✭ 120 (-9.09%)
Mutual labels:  avro
Kebs
Scala library to eliminate boilerplate
Stars: ✭ 113 (-14.39%)
Mutual labels:  avro

Logo

Go Report Card Build Status Coverage Status GoDoc GitHub release GitHub license

A fast Go avro codec

Overview

Install with:

go get github.com/hamba/avro

Usage

type SimpleRecord struct {
	A int64  `avro:"a"`
	B string `avro:"b"`
}

schema, err := avro.Parse(`{
    "type": "record",
    "name": "simple",
    "namespace": "org.hamba.avro",
    "fields" : [
        {"name": "a", "type": "long"},
        {"name": "b", "type": "string"}
    ]
}`)
if err != nil {
	log.Fatal(err)
}

in := SimpleRecord{A: 27, B: "foo"}

data, err := avro.Marshal(schema, in)
if err != nil {
	log.Fatal(err)
}

fmt.Println(data)
// Outputs: [54 6 102 111 111]

out := SimpleRecord{}
err = avro.Unmarshal(schema, data, &out)
if err != nil {
	log.Fatal(err)
}

fmt.Println(out)
// Outputs: {27 foo}

More examples in the godoc.

Types Conversions

Avro Go Struct Go Interface
null nil nil
boolean bool bool
bytes []byte []byte
float float32 float32
double float64 float64
long int64 int64
int int, int32, int16, int8 int
string string string
array []T []interface{}
enum string string
fixed [n]byte []byte
map map[string]T{} map[string]interface{}
record struct map[string]interface{}
union see below see below
int.date time.Time time.Time
int.time-millis time.Duration time.Duration
long.time-micros time.Duration time.Duration
long.timestamp-millis time.Time time.Time
long.timestamp-micros time.Time time.Time
bytes.decimal *big.Rat *big.Rat
fixed.decimal *big.Rat *big.Rat
Unions

The following union types are accepted: map[string]interface{}, *T and interface{}.

  • map[string]interface{}: If the union value is nil, a nil map will be en/decoded. When a non-nil union value is encountered, a single key is en/decoded. The key is the avro type name, or scheam full name in the case of a named schema (enum, fixed or record).
  • *T: This is allowed in a "nullable" union. A nullable union is defined as a two schema union, with one of the types being null (ie. ["null", "string"] or ["string", "null"]), in this case a *T is allowed, with T matching the conversion table above.
  • interface{}: An interface can be provided and the type or name resolved. Primitive types are pre-registered, but named types, maps and slices will need to be registered with the Register function. In the case of arrays and maps the enclosed schema type or name is postfix to the type with a : separator, e.g "map:string". If any type cannot be resolved the map type above is used unless Config.UnionResolutionError is set to true in which case an error is returned.
TextMarshaler and TextUnmarshaler

The interfaces TextMarshaler and TextUnmarshaler are supported for a string schema type. The object will be tested first for implementation of these interfaces, in the case of a string schema, before trying regular encoding and decoding.

Benchmark

Benchmark source code can be found at: https://github.com/nrwiersma/avro-benchmarks

BenchmarkGoAvroDecode-8     	  326304	      3608 ns/op	     442 B/op	      27 allocs/op
BenchmarkGoAvroEncode-8     	  282902	      4367 ns/op	     856 B/op	      63 allocs/op
BenchmarkHambaDecode-8      	 2133788	       568 ns/op	      64 B/op	       4 allocs/op
BenchmarkHambaEncode-8      	 2635092	       444 ns/op	     112 B/op	       1 allocs/op
BenchmarkLinkedinDecode-8   	  583681	      2138 ns/op	    1728 B/op	      35 allocs/op
BenchmarkLinkedinEncode-8   	 1527082	       785 ns/op	     248 B/op	       5 allocs/op

Always benchmark with your own workload. The result depends heavily on the data input.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].