Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Accessor should consider avro schema evolution #52

Closed
Kasen opened this issue Feb 22, 2018 · 1 comment
Closed

Accessor should consider avro schema evolution #52

Kasen opened this issue Feb 22, 2018 · 1 comment
Labels

Comments

@Kasen
Copy link
Contributor

Kasen commented Feb 22, 2018

We have two versions of Avro-schema and four service fields:
0001:

"service": {
    "type": "record",
    "name": "service",
    "fields": [
        {"name": "uid", "type": "string"},
        {"name": "p1", "type": "long"},
        {"name": "p2", "type": "long"}
    ]
}

0002:

"service": {
    "type": "record",
    "name": "service",
    "fields": [
        {"name": "uid", "type": "string"},
        {"name": "p1", "type": "long"},
        {"name": "p2", "type": "long"},
        {"name": "p3", "type": "string", "default": "test avro default"}
    ]
}

If data has been pushed in tarantool, then we the tuple ['79031234566', '2451111545', '0002', 1519231048.4021, '79031234566', 2, 2, 'test avro default'] will be stored. So if I try to receive data through graphql, I will receive an error in unflatten function. Because in the first version of the schema we don't have 'p3' field.

@Kasen Kasen added the prio1 label Feb 22, 2018
@Totktonada
Copy link
Member

Proposed to handle this on pluggable accessor level with saving accessor-general logic. We need to move unflatten function into as certain accessors’ function, that transforms tuple and metainfo into object. It will allow to implement reading objects using different version of schemas.

Totktonada added a commit that referenced this issue Feb 26, 2018
Closes #52 (moves responsibility to an user of the library).
Totktonada added a commit that referenced this issue Feb 27, 2018
Closes #52 (moves responsibility to an user of the library).
Totktonada added a commit that referenced this issue Feb 28, 2018
Closes #52 (moves responsibility to an user of the library).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants