You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Patrick Hunt (JIRA)" <ji...@apache.org> on 2009/11/18 06:52:39 UTC
[jira] Created: (AVRO-207) python parser doesn't check for
ambiguous unions/enums
python parser doesn't check for ambiguous unions/enums
------------------------------------------------------
Key: AVRO-207
URL: https://issues.apache.org/jira/browse/AVRO-207
Project: Avro
Issue Type: Bug
Components: python
Affects Versions: 1.2.0
Reporter: Patrick Hunt
Priority: Minor
The python parser doesn't flag these as ambiguous (java flags the union, but not the enum)
"response": {"name":"E1", "type":"enum", "symbols":["AA", "AA"]},
"response": ["long","long"],
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (AVRO-207) python parser doesn't check for
ambiguous unions/enums
Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeff Hammerbacher updated AVRO-207:
-----------------------------------
Status: Patch Available (was: Open)
> python parser doesn't check for ambiguous unions/enums
> ------------------------------------------------------
>
> Key: AVRO-207
> URL: https://issues.apache.org/jira/browse/AVRO-207
> Project: Avro
> Issue Type: Bug
> Components: python
> Affects Versions: 1.2.0
> Reporter: Patrick Hunt
> Assignee: Jeff Hammerbacher
> Priority: Minor
> Attachments: AVRO-207.patch
>
>
> The python parser doesn't flag these as ambiguous (java flags the union, but not the enum)
> "response": {"name":"E1", "type":"enum", "symbols":["AA", "AA"]},
> "response": ["long","long"],
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (AVRO-207) python parser doesn't check for
ambiguous unions/enums
Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeff Hammerbacher updated AVRO-207:
-----------------------------------
Attachment: AVRO-207.patch
Added both schemas to the EXAMPLE_SCHEMAS that get tested in test_schema.py. Both now throw an AvroException.
Question: do we need to update the specification to indicate that an enum's list of symbols cannot contain a duplicate?
> python parser doesn't check for ambiguous unions/enums
> ------------------------------------------------------
>
> Key: AVRO-207
> URL: https://issues.apache.org/jira/browse/AVRO-207
> Project: Avro
> Issue Type: Bug
> Components: python
> Affects Versions: 1.2.0
> Reporter: Patrick Hunt
> Assignee: Jeff Hammerbacher
> Priority: Minor
> Attachments: AVRO-207.patch
>
>
> The python parser doesn't flag these as ambiguous (java flags the union, but not the enum)
> "response": {"name":"E1", "type":"enum", "symbols":["AA", "AA"]},
> "response": ["long","long"],
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (AVRO-207) python parser doesn't check for
ambiguous unions/enums
Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeff Hammerbacher reassigned AVRO-207:
--------------------------------------
Assignee: Jeff Hammerbacher
> python parser doesn't check for ambiguous unions/enums
> ------------------------------------------------------
>
> Key: AVRO-207
> URL: https://issues.apache.org/jira/browse/AVRO-207
> Project: Avro
> Issue Type: Bug
> Components: python
> Affects Versions: 1.2.0
> Reporter: Patrick Hunt
> Assignee: Jeff Hammerbacher
> Priority: Minor
>
> The python parser doesn't flag these as ambiguous (java flags the union, but not the enum)
> "response": {"name":"E1", "type":"enum", "symbols":["AA", "AA"]},
> "response": ["long","long"],
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (AVRO-207) python parser doesn't check for
ambiguous unions/enums
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798509#action_12798509 ]
Doug Cutting commented on AVRO-207:
-----------------------------------
There's no ambiguity for enums, since the spec says that the first matching is always used. With a union the restriction permits optimizations: by not allowing two arrays in a union, a writer using runtime types need only check whether an object is an array and does not have to check its elements, similarly for maps. Also, semantics would get complex to specify without this restriction, e.g., if you have a union with two arrays each with union element types that might involve promotion, etc. I don't recall all the details, but trying to implement things correctly without this restriction on unions proved very difficult. But implementing enums correctly without prohibiting duplicates is easy.
That said, duplicates in enums will probably break specific implementations, since, e.g., Java's enum does not permit duplicates.
> python parser doesn't check for ambiguous unions/enums
> ------------------------------------------------------
>
> Key: AVRO-207
> URL: https://issues.apache.org/jira/browse/AVRO-207
> Project: Avro
> Issue Type: Bug
> Components: python
> Affects Versions: 1.2.0
> Reporter: Patrick Hunt
> Assignee: Jeff Hammerbacher
> Priority: Minor
> Attachments: AVRO-207.patch
>
>
> The python parser doesn't flag these as ambiguous (java flags the union, but not the enum)
> "response": {"name":"E1", "type":"enum", "symbols":["AA", "AA"]},
> "response": ["long","long"],
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (AVRO-207) python parser doesn't check for
ambiguous unions/enums
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Doug Cutting updated AVRO-207:
------------------------------
Resolution: Fixed
Fix Version/s: 1.3.0
Hadoop Flags: [Reviewed]
Status: Resolved (was: Patch Available)
I just committed this. Thanks, Jeff!
> python parser doesn't check for ambiguous unions/enums
> ------------------------------------------------------
>
> Key: AVRO-207
> URL: https://issues.apache.org/jira/browse/AVRO-207
> Project: Avro
> Issue Type: Bug
> Components: python
> Affects Versions: 1.2.0
> Reporter: Patrick Hunt
> Assignee: Jeff Hammerbacher
> Priority: Minor
> Fix For: 1.3.0
>
> Attachments: AVRO-207.patch
>
>
> The python parser doesn't flag these as ambiguous (java flags the union, but not the enum)
> "response": {"name":"E1", "type":"enum", "symbols":["AA", "AA"]},
> "response": ["long","long"],
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.