[jira] [Commented] (AVRO-1767) Simplify union wrapping logic.

2015-12-08 Thread Matthieu Monsch (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15047980#comment-15047980
 ] 

Matthieu Monsch commented on AVRO-1767:
---

Thank you [~rdblue]! Agreed on the note.

> Simplify union wrapping logic.
> --
>
> Key: AVRO-1767
> URL: https://issues.apache.org/jira/browse/AVRO-1767
> Project: Avro
>  Issue Type: Improvement
>  Components: javascript
>Reporter: Matthieu Monsch
>Assignee: Ryan Blue
> Fix For: 1.8.0
>
> Attachments: AVRO-1767.patch
>
>
> Previously, union wrapping during `type.clone` calls would be done in place
> of normal copy. Now it is done as a backup if a normal copy fails. This is
> more consistent with the documentation, and makes it much simpler to wrap
> nested unions.
> See here for more information and examples: 
> https://github.com/mtth/avsc/issues/16
> Other changes:
> + Add an optional argument to `type.getName` to expose built-in type names
>   (useful to implement an "optional" logical type for example).
> + Document (and rename) `assertLogicalTypes` parsing option.
> + Tweak logical type validity check, enabling error hooks to work even when a
>   logical type is valid for a subset of its underlying type's values (e.g. 
> when
>   defining an "even integer" type). Previously the path would have been 
> correct
>   but the type would have been that of the underlying one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-1767) Simplify union wrapping logic.

2015-12-08 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15047613#comment-15047613
 ] 

Hudson commented on AVRO-1767:
--

SUCCESS: Integrated in AvroJava #559 (See 
[https://builds.apache.org/job/AvroJava/559/])
AVRO-1767: Fall back to unwrapped union values. Contributed by Matthieu Monsch.

Previously, union wrapping during `type.clone` calls would be done in
place of normal copy. Now it is done as a backup if a normal copy fails.
This is more consistent with the documentation, and makes it much
simpler to wrap nested unions.

Other changes:

+ Add an optional argument to `type.getName` to expose built-in type
  names (useful to implement an "optional" logical type for example).
+ Document (and rename) `assertLogicalTypes` parsing option.
+ Tweak logical type validity check, enabling error hooks to work even
  when a logical type is valid for a subset of its underlying type's
  values (e.g.  when defining an "even integer" type). Previously the
  path would have been correct but the type would have been that of the
  underlying one. (blue: rev 1718715)
* trunk/CHANGES.txt
* trunk/lang/js/doc/API.md
* trunk/lang/js/lib/schemas.js
* trunk/lang/js/test/test_schemas.js


> Simplify union wrapping logic.
> --
>
> Key: AVRO-1767
> URL: https://issues.apache.org/jira/browse/AVRO-1767
> Project: Avro
>  Issue Type: Improvement
>  Components: javascript
>Reporter: Matthieu Monsch
>Assignee: Ryan Blue
> Fix For: 1.8.0
>
> Attachments: AVRO-1767.patch
>
>
> Previously, union wrapping during `type.clone` calls would be done in place
> of normal copy. Now it is done as a backup if a normal copy fails. This is
> more consistent with the documentation, and makes it much simpler to wrap
> nested unions.
> See here for more information and examples: 
> https://github.com/mtth/avsc/issues/16
> Other changes:
> + Add an optional argument to `type.getName` to expose built-in type names
>   (useful to implement an "optional" logical type for example).
> + Document (and rename) `assertLogicalTypes` parsing option.
> + Tweak logical type validity check, enabling error hooks to work even when a
>   logical type is valid for a subset of its underlying type's values (e.g. 
> when
>   defining an "even integer" type). Previously the path would have been 
> correct
>   but the type would have been that of the underlying one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-1767) Simplify union wrapping logic.

2015-12-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15047506#comment-15047506
 ] 

ASF subversion and git services commented on AVRO-1767:
---

Commit 1718715 from [~b...@cloudera.com] in branch 'avro/trunk'
[ https://svn.apache.org/r1718715 ]

AVRO-1767: Fall back to unwrapped union values. Contributed by Matthieu Monsch.

Previously, union wrapping during `type.clone` calls would be done in
place of normal copy. Now it is done as a backup if a normal copy fails.
This is more consistent with the documentation, and makes it much
simpler to wrap nested unions.

Other changes:

+ Add an optional argument to `type.getName` to expose built-in type
  names (useful to implement an "optional" logical type for example).
+ Document (and rename) `assertLogicalTypes` parsing option.
+ Tweak logical type validity check, enabling error hooks to work even
  when a logical type is valid for a subset of its underlying type's
  values (e.g.  when defining an "even integer" type). Previously the
  path would have been correct but the type would have been that of the
  underlying one.

> Simplify union wrapping logic.
> --
>
> Key: AVRO-1767
> URL: https://issues.apache.org/jira/browse/AVRO-1767
> Project: Avro
>  Issue Type: Improvement
>  Components: javascript
>Reporter: Matthieu Monsch
>Assignee: Ryan Blue
> Attachments: AVRO-1767.patch
>
>
> Previously, union wrapping during `type.clone` calls would be done in place
> of normal copy. Now it is done as a backup if a normal copy fails. This is
> more consistent with the documentation, and makes it much simpler to wrap
> nested unions.
> See here for more information and examples: 
> https://github.com/mtth/avsc/issues/16
> Other changes:
> + Add an optional argument to `type.getName` to expose built-in type names
>   (useful to implement an "optional" logical type for example).
> + Document (and rename) `assertLogicalTypes` parsing option.
> + Tweak logical type validity check, enabling error hooks to work even when a
>   logical type is valid for a subset of its underlying type's values (e.g. 
> when
>   defining an "even integer" type). Previously the path would have been 
> correct
>   but the type would have been that of the underlying one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-1767) Simplify union wrapping logic.

2015-12-08 Thread Ryan Blue (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15047504#comment-15047504
 ] 

Ryan Blue commented on AVRO-1767:
-

This looks good to me.

Just one note on having several changes in one patch though... I think it makes 
sense most of the time to keep changes in separate commits/patches. I know that 
increases overhead a bit, but then we have more ability to revert individual 
changes that end up being problematic. For example, if we discover a bug in 
this patch and want to back out the union handling change, we have to go back 
to editing the code to sort out what is broken and what isn't. It also means 
it's easier to review things (and faster) because the reviewer doesn't have to 
find what differences are associated with each high-level change. Small, 
independent patches are the easiest to work with in a lot of ways.

> Simplify union wrapping logic.
> --
>
> Key: AVRO-1767
> URL: https://issues.apache.org/jira/browse/AVRO-1767
> Project: Avro
>  Issue Type: Improvement
>  Components: javascript
>Reporter: Matthieu Monsch
>Assignee: Ryan Blue
> Attachments: AVRO-1767.patch
>
>
> Previously, union wrapping during `type.clone` calls would be done in place
> of normal copy. Now it is done as a backup if a normal copy fails. This is
> more consistent with the documentation, and makes it much simpler to wrap
> nested unions.
> See here for more information and examples: 
> https://github.com/mtth/avsc/issues/16
> Other changes:
> + Add an optional argument to `type.getName` to expose built-in type names
>   (useful to implement an "optional" logical type for example).
> + Document (and rename) `assertLogicalTypes` parsing option.
> + Tweak logical type validity check, enabling error hooks to work even when a
>   logical type is valid for a subset of its underlying type's values (e.g. 
> when
>   defining an "even integer" type). Previously the path would have been 
> correct
>   but the type would have been that of the underlying one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-1767) Simplify union wrapping logic.

2015-12-08 Thread Ryan Blue (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15047136#comment-15047136
 ] 

Ryan Blue commented on AVRO-1767:
-

No problem, sorry for the delay!

> Simplify union wrapping logic.
> --
>
> Key: AVRO-1767
> URL: https://issues.apache.org/jira/browse/AVRO-1767
> Project: Avro
>  Issue Type: Improvement
>  Components: javascript
>Reporter: Matthieu Monsch
>Assignee: Ryan Blue
> Attachments: AVRO-1767.patch
>
>
> Previously, union wrapping during `type.clone` calls would be done in place
> of normal copy. Now it is done as a backup if a normal copy fails. This is
> more consistent with the documentation, and makes it much simpler to wrap
> nested unions.
> See here for more information and examples: 
> https://github.com/mtth/avsc/issues/16
> Other changes:
> + Add an optional argument to `type.getName` to expose built-in type names
>   (useful to implement an "optional" logical type for example).
> + Document (and rename) `assertLogicalTypes` parsing option.
> + Tweak logical type validity check, enabling error hooks to work even when a
>   logical type is valid for a subset of its underlying type's values (e.g. 
> when
>   defining an "even integer" type). Previously the path would have been 
> correct
>   but the type would have been that of the underlying one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-1767) Simplify union wrapping logic.

2015-12-07 Thread Matthieu Monsch (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15046307#comment-15046307
 ] 

Matthieu Monsch commented on AVRO-1767:
---

Hi [~rdblue], could you take a look at this patch? It's very small and makes it 
much easier to customize the library to emit "standard" JSON for unions.

> Simplify union wrapping logic.
> --
>
> Key: AVRO-1767
> URL: https://issues.apache.org/jira/browse/AVRO-1767
> Project: Avro
>  Issue Type: Improvement
>  Components: javascript
>Reporter: Matthieu Monsch
>Assignee: Ryan Blue
> Attachments: AVRO-1767.patch
>
>
> Previously, union wrapping during `type.clone` calls would be done in place
> of normal copy. Now it is done as a backup if a normal copy fails. This is
> more consistent with the documentation, and makes it much simpler to wrap
> nested unions.
> See here for more information and examples: 
> https://github.com/mtth/avsc/issues/16
> Other changes:
> + Add an optional argument to `type.getName` to expose built-in type names
>   (useful to implement an "optional" logical type for example).
> + Document (and rename) `assertLogicalTypes` parsing option.
> + Tweak logical type validity check, enabling error hooks to work even when a
>   logical type is valid for a subset of its underlying type's values (e.g. 
> when
>   defining an "even integer" type). Previously the path would have been 
> correct
>   but the type would have been that of the underlying one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)