Skip to content

logicalType support #29

@lukaszkorecki

Description

@lukaszkorecki

Hi! Thank you for the library, it's terribly useful (finally we can stop using JSON ;-))

I was wondering if logicalType property is supported - https://avro.apache.org/docs/1.8.0/spec.html#Logical+Types

From my quick experiments it looks like they don't work, or I'm simply doing something wrong:

(require '[abracad.avro :as avro])

(def schema
  (avro/parse-schema
   {:type :record
    :name "Thing"
    :fields [{:name "name", :type :string}
             {:name "timestamp" :logicalType "date" :type :int}]}))

(def ex
  { :name "Foo" :timestamp 1491306685 })

(->> (avro/binary-encoded schema ex)
     (avro/decode schema))

;; => {:name "Foo", :timestamp 1491306685}

if it's not supported, I'm happy to add support but I'd need a bit of help as to where should I start 👍

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions