You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Cristian Opris (JIRA)" <ji...@apache.org> on 2012/09/18 18:36:07 UTC
[jira] [Created] (AVRO-1168) IDL Tool - Field properties are added
against schema instead of field
Cristian Opris created AVRO-1168:
------------------------------------
Summary: IDL Tool - Field properties are added against schema instead of field
Key: AVRO-1168
URL: https://issues.apache.org/jira/browse/AVRO-1168
Project: Avro
Issue Type: Bug
Components: java
Affects Versions: 1.7.1
Reporter: Cristian Opris
Priority: Minor
In Idl.jj, field properties are added against the field *schema* instead of the field, resulting in an error if different fields of the same *record*
type are annotated with the same property name.
Example:
<code>
record RecordA {
}
record RecordB {
@Prop("")
RecordA a1
@Prop("")
RecordA a2
}
</code>
Note this fails even if a1 and a2 are in different records (since the Schema instance is shared)
Proposed fix: - change Idl.jj to add props agains the fields props, not the schema:
<code>
for (String key : props.keySet())
type.addProp(key, getTextProp(key, props, token));
</code>
should read:
<code>
field.addProp(...)
</code>
--
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] [Resolved] (AVRO-1168) IDL Tool - Field properties are added
against schema instead of field
Posted by "Cristian Opris (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-1168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cristian Opris resolved AVRO-1168.
----------------------------------
Resolution: Invalid
Release Note:
Actually I realized you can annotate both the field schema and the field itself.
string @Prop field
Strange, but it works, so closing
> IDL Tool - Field properties are added against schema instead of field
> ---------------------------------------------------------------------
>
> Key: AVRO-1168
> URL: https://issues.apache.org/jira/browse/AVRO-1168
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.7.1
> Reporter: Cristian Opris
> Priority: Minor
>
> In Idl.jj, field properties are added against the field *schema* instead of the field, resulting in an error if different fields of the same *record*
> type are annotated with the same property name.
> Example:
> <code>
> record RecordA {
> }
> record RecordB {
> @Prop("")
> RecordA a1
> @Prop("")
> RecordA a2
> }
> </code>
> Note this fails even if a1 and a2 are in different records (since the Schema instance is shared)
> Proposed fix: - change Idl.jj to add props agains the fields props, not the schema:
> <code>
> for (String key : props.keySet())
> type.addProp(key, getTextProp(key, props, token));
> </code>
> should read:
> <code>
> field.addProp(...)
> </code>
--
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-1168) IDL Tool - Field properties are
added against schema instead of field
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-1168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457956#comment-13457956 ]
Doug Cutting commented on AVRO-1168:
------------------------------------
For the record, the ability to separately annotate the field and its schema is documented at:
http://avro.apache.org/docs/current/idl.html#minutiae_annotations
> IDL Tool - Field properties are added against schema instead of field
> ---------------------------------------------------------------------
>
> Key: AVRO-1168
> URL: https://issues.apache.org/jira/browse/AVRO-1168
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.7.1
> Reporter: Cristian Opris
> Priority: Minor
>
> In Idl.jj, field properties are added against the field *schema* instead of the field, resulting in an error if different fields of the same *record*
> type are annotated with the same property name.
> Example:
> <code>
> record RecordA {
> }
> record RecordB {
> @Prop("")
> RecordA a1
> @Prop("")
> RecordA a2
> }
> </code>
> Note this fails even if a1 and a2 are in different records (since the Schema instance is shared)
> Proposed fix: - change Idl.jj to add props agains the fields props, not the schema:
> <code>
> for (String key : props.keySet())
> type.addProp(key, getTextProp(key, props, token));
> </code>
> should read:
> <code>
> field.addProp(...)
> </code>
--
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