You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by tjwp <gi...@git.apache.org> on 2016/08/23 18:51:27 UTC

[GitHub] avro pull request #116: AVRO-1695: Ruby support for logical types revisited

GitHub user tjwp opened a pull request:

    https://github.com/apache/avro/pull/116

    AVRO-1695: Ruby support for logical types revisited

    This is a continuation of the changes originally submitted in https://github.com/apache/avro/pull/44 for https://issues.apache.org/jira/browse/AVRO-1695.
    
    Original description:
    
        Add Ruby support for logical types
    
        Only logical types that map directly to Ruby standard library types are supported:
    
        * date maps to Date;
        * timestamp-millis and timestamp-micros map to Time.
    
        The remaining types are difficult to cleanly map to Ruby types, so I've refrained from doing so.   
        Furthermore, there's no direct support for plugging in custom mappers \u2013 I'm unsure if this is     
        needed.
    
    I've tried to add address the feedback from the original PR, primarily pushing some of the implementation into `Avro::Schema.real_parse` and ensuring that the Ruby tests cover all the same cases as the Java conversion tests.
    
    One change I've made here is to have `Avro::Schema#logical_type` return the name of the logical type.
    
    For now I've preserved the original changes as a separate commit, but I can rebase the changes if this gets accepted.
    
    CC @dasch

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/salsify/avro tjwp/ruby-logical-types

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/avro/pull/116.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #116
    
----
commit cde8338f652b9a5f0864fb2d7c679720f9c71efd
Author: Daniel Schierbeck <da...@zendesk.com>
Date:   2016-08-23T14:48:59Z

    Add Ruby support for logical types
    
    Only logical types that map directly to Ruby standard library types are
    supported:
    
    * `date` maps to Date;
    * `timestamp-millis` and `timestamp-micros` map to Time.

commit f1a616857b8c9eeca04335ed851ee8831234bc1c
Author: Tim Perkins <tp...@salsify.com>
Date:   2016-08-23T16:50:33Z

    PR Feedback
    
    * Move logical_type determination into `.real_parse`.
    * `#logical_type` now returns the logical type name.
    * Change logical type "adapters" to modules since there will be no instances.
    * Parity with Java conversion tests.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---