Skip to content

Support logicalTypes #27

Open
Open
@smyrman

Description

Support setting logicalTypes in scema, e.g.:

var floatAvroSchema = avro.MustParseSchema(`{
		"type": "record",
		"name": "FloatRecord",
		"fields": [
			{ "name": "time",  "type": "long", "logicalType": "timestamp-micros"},
			{ "name": "value",  "type": "double"}
		]
}`)

Cutrrently, when parsed, the "logicalType" key is dropped, as there is no field for it in SchemaField.

This is useful e.g. when importing data to Google BigQuery with --use_avro_logical_types:
https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-avro#logical_types

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