You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Alexandre Normand (JIRA)" <ji...@apache.org> on 2012/09/05 21:40:07 UTC

[jira] [Created] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys

Alexandre Normand created AVRO-1147:
---------------------------------------

             Summary: Allow Stringable Map keys in addition to pure String keys
                 Key: AVRO-1147
                 URL: https://issues.apache.org/jira/browse/AVRO-1147
             Project: Avro
          Issue Type: Improvement
          Components: java
    Affects Versions: 1.7.0
            Reporter: Alexandre Normand


I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 

However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 

Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452466#comment-13452466 ] 

Alexandre Normand commented on AVRO-1147:
-----------------------------------------

It looks good. Indeed, I had missed the @Stringable on map keys. I thought I had cleaned up the writeMapKey signature and used Decoder though...but I think I may have selected the wrong patch version when uploading. I'll be more careful next time. 

I think you can go ahead with the commit. It's going to be very useful. Thanks for the quick response!
                
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>            Assignee: Alexandre Normand
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-1147:
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7.2
         Assignee: Alexandre Normand  (was: Doug Cutting)
           Status: Resolved  (was: Patch Available)

I just committed this.  Thanks, Alexandre!

(BTW, we used the Assignee field to indicate who's written the majority of the patch committed.)
                
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>            Assignee: Alexandre Normand
>              Labels: newbie, patch
>             Fix For: 1.7.2
>
>         Attachments: AVRO-1147.patch, AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451139#comment-13451139 ] 

Doug Cutting commented on AVRO-1147:
------------------------------------

I think this is reasonable.  I have some code that implements this but I'd like to improve it a bit still.  I'll try to post something Monday unless you post something first.
                
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexandre Normand updated AVRO-1147:
------------------------------------

    Attachment: AVRO-1147.patch

I brought by my changes to TestReflect and made that modification to add the Integer.class to stringables on a new instance of ReflectData. 
                
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>            Assignee: Alexandre Normand
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch, AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexandre Normand updated AVRO-1147:
------------------------------------

    Attachment: AVRO-1147.patch
    
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452615#comment-13452615 ] 

Alexandre Normand commented on AVRO-1147:
-----------------------------------------

Got it. Thanks Doug.
                
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>            Assignee: Alexandre Normand
>              Labels: newbie, patch
>             Fix For: 1.7.2
>
>         Attachments: AVRO-1147.patch, AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexandre Normand updated AVRO-1147:
------------------------------------

    Summary: Allow Stringable Map keys in addition to pure String keys (avro reflection)  (was: Allow Stringable Map keys in addition to pure String keys)
    
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexandre Normand reassigned AVRO-1147:
---------------------------------------

    Assignee: Doug Cutting  (was: Alexandre Normand)
    
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>            Assignee: Doug Cutting
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452465#comment-13452465 ] 

Doug Cutting commented on AVRO-1147:
------------------------------------

Sorry, I lost your test changes and used the test I'd written instead in my patch.  If you like, we can use your tests; please post a patch that includes them instead.

As for adding Integer.class as a stringable, it would be safest to do that with something like:

ReflectData data = new ReflectData().addStringable(Integer.class);

That way it wouldn't alter the default instance.
                
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>            Assignee: Alexandre Normand
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450334#comment-13450334 ] 

Alexandre Normand commented on AVRO-1147:
-----------------------------------------

I've been playing around with the code to add a property on map schemas for which the key is a stringable class. It's working but before I put more time and effort into this to make this more real, I would love to hear some opinions either for or against that feature. 

Anyone?
                
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexandre Normand reassigned AVRO-1147:
---------------------------------------

    Assignee: Doug Cutting  (was: Alexandre Normand)
    
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>            Assignee: Doug Cutting
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch, AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-1147:
-------------------------------

    Attachment: AVRO-1147.patch

I merged your patch and mine.  You missed the case where the map key had a @Stringable annotation, also the parameter to writeMapKey can just be a Decoder, not a ResolvingDecoder.  Mine was still rough, using the old "java-class" property and readString methods rather than defining a new property and method as you did.

Does this look reasonable?  If so, I'll commit it.
                
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexandre Normand reassigned AVRO-1147:
---------------------------------------

    Assignee: Alexandre Normand  (was: Doug Cutting)
    
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>            Assignee: Alexandre Normand
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexandre Normand updated AVRO-1147:
------------------------------------

    Labels: newbie patch  (was: )
    Status: Patch Available  (was: Open)

Not trying to beat you to the punch but I thought I'd share my re-worked version of the patch now ;). I may be violating the rules here as the patch is actually a superset of your latest patch for AVRO-1146 (I needed it to make this work). 

I moved {{TestReflect}} under the {{org.apache.avro.reflect}} package as it both seemed like the right place for it and it allowed me to use the {{protected}} version of {{ReflectData.compare}} for the new tests. 

Note that I'm adding Integer.class to stringables on ReflectData in the {{TestReflect}} unit test and I _did_ pause for a minute to think about implications of adding it as the stringableClasses set is shared for both map keys as well as straight types. Since {{Integer.class}} is already bucketed as a primitive before we check for stringableClasses in a non-map scenario, it should be fine though. 

Thoughts?

                
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting reassigned AVRO-1147:
----------------------------------

    Assignee: Alexandre Normand
    
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>            Assignee: Alexandre Normand
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexandre Normand updated AVRO-1147:
------------------------------------

    Description: 
I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 

However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 

Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

  was:
I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 

However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 

Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)?

    
> Allow Stringable Map keys in addition to pure String keys
> ---------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1147) Allow Stringable Map keys in addition to pure String keys (avro reflection)

Posted by "Alexandre Normand (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452473#comment-13452473 ] 

Alexandre Normand commented on AVRO-1147:
-----------------------------------------

My last comment was written while you were writing yours...let me post a patch that brings those tests back...
                
> Allow Stringable Map keys in addition to pure String keys (avro reflection)
> ---------------------------------------------------------------------------
>
>                 Key: AVRO-1147
>                 URL: https://issues.apache.org/jira/browse/AVRO-1147
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.7.0
>            Reporter: Alexandre Normand
>            Assignee: Doug Cutting
>              Labels: newbie, patch
>         Attachments: AVRO-1147.patch, AVRO-1147.patch
>
>
> I'm using avro reflection for some serialization that doesn't require the best performance for some short-lived data. 
> However, the object I'm trying to serialize uses a {{Map}} with non-String keys (the key class is {{Integer}}) and, because of the strict restriction on Map keys being Strings, it fails. 
> Could we consider allowing Map keys to be *{{Stringable}}* classes (I'm thinking of something similar to Doug's solution in https://issues.apache.org/jira/browse/AVRO-1146)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira