You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Douglas Creager (JIRA)" <ji...@apache.org> on 2011/01/24 17:09:48 UTC

[jira] Created: (AVRO-744) Helper macros for extracting and setting record field values

Helper macros for extracting and setting record field values
------------------------------------------------------------

                 Key: AVRO-744
                 URL: https://issues.apache.org/jira/browse/AVRO-744
             Project: Avro
          Issue Type: New Feature
          Components: c
            Reporter: Douglas Creager
            Assignee: Douglas Creager
         Attachments: 0001-Helper-macros-for-extracting-and-setting-record-fiel.patch

I've created two helper macros that can be used to extract or set the value of a record field using fewer function calls.  So instead of

{code}
int  rc;
avro_datum_t  field;
char  *value;
rc = avro_record_get(record, "name", &field);
rc = avro_string_get(field, &value);
{code}

you can do:

{code}
int  rc;
char  *value;
avro_record_get_field_value(rc, record, string, "name", &value);
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-744) Helper macros for extracting and setting record field values

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

Bruce Mitchener commented on AVRO-744:
--------------------------------------

I still want to bring back my older patch that used atoms instead of char* for record field names....


> Helper macros for extracting and setting record field values
> ------------------------------------------------------------
>
>                 Key: AVRO-744
>                 URL: https://issues.apache.org/jira/browse/AVRO-744
>             Project: Avro
>          Issue Type: New Feature
>          Components: c
>            Reporter: Douglas Creager
>            Assignee: Douglas Creager
>         Attachments: 0001-Helper-macros-for-extracting-and-setting-record-fiel.patch
>
>
> I've created two helper macros that can be used to extract or set the value of a record field using fewer function calls.  So instead of
> {code}
> int  rc;
> avro_datum_t  field;
> char  *value;
> rc = avro_record_get(record, "name", &field);
> rc = avro_string_get(field, &value);
> {code}
> you can do:
> {code}
> int  rc;
> char  *value;
> avro_record_get_field_value(rc, record, string, "name", &value);
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-744) Helper macros for extracting and setting record field values

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

Douglas Creager updated AVRO-744:
---------------------------------

    Attachment: 0001-Helper-macros-for-extracting-and-setting-record-fiel.patch

> Helper macros for extracting and setting record field values
> ------------------------------------------------------------
>
>                 Key: AVRO-744
>                 URL: https://issues.apache.org/jira/browse/AVRO-744
>             Project: Avro
>          Issue Type: New Feature
>          Components: c
>            Reporter: Douglas Creager
>            Assignee: Douglas Creager
>         Attachments: 0001-Helper-macros-for-extracting-and-setting-record-fiel.patch
>
>
> I've created two helper macros that can be used to extract or set the value of a record field using fewer function calls.  So instead of
> {code}
> int  rc;
> avro_datum_t  field;
> char  *value;
> rc = avro_record_get(record, "name", &field);
> rc = avro_string_get(field, &value);
> {code}
> you can do:
> {code}
> int  rc;
> char  *value;
> avro_record_get_field_value(rc, record, string, "name", &value);
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-744) Helper macros for extracting and setting record field values

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

Douglas Creager commented on AVRO-744:
--------------------------------------

I like atoms, too.  That change shouldn't cause much of a problem with this patch — the two new functions are actually macros, which pass the field name to avro_record_get as-is.  So if you change avro_record_get to take in an atom, then get_field_value and set_field_value would start taking in atoms, too.

> Helper macros for extracting and setting record field values
> ------------------------------------------------------------
>
>                 Key: AVRO-744
>                 URL: https://issues.apache.org/jira/browse/AVRO-744
>             Project: Avro
>          Issue Type: New Feature
>          Components: c
>            Reporter: Douglas Creager
>            Assignee: Douglas Creager
>         Attachments: 0001-Helper-macros-for-extracting-and-setting-record-fiel.patch
>
>
> I've created two helper macros that can be used to extract or set the value of a record field using fewer function calls.  So instead of
> {code}
> int  rc;
> avro_datum_t  field;
> char  *value;
> rc = avro_record_get(record, "name", &field);
> rc = avro_string_get(field, &value);
> {code}
> you can do:
> {code}
> int  rc;
> char  *value;
> avro_record_get_field_value(rc, record, string, "name", &value);
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AVRO-744) Helper macros for extracting and setting record field values

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

Douglas Creager resolved AVRO-744.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5.0

Committed to SVN.

> Helper macros for extracting and setting record field values
> ------------------------------------------------------------
>
>                 Key: AVRO-744
>                 URL: https://issues.apache.org/jira/browse/AVRO-744
>             Project: Avro
>          Issue Type: New Feature
>          Components: c
>            Reporter: Douglas Creager
>            Assignee: Douglas Creager
>             Fix For: 1.5.0
>
>         Attachments: 0001-Helper-macros-for-extracting-and-setting-record-fiel.patch
>
>
> I've created two helper macros that can be used to extract or set the value of a record field using fewer function calls.  So instead of
> {code}
> int  rc;
> avro_datum_t  field;
> char  *value;
> rc = avro_record_get(record, "name", &field);
> rc = avro_string_get(field, &value);
> {code}
> you can do:
> {code}
> int  rc;
> char  *value;
> avro_record_get_field_value(rc, record, string, "name", &value);
> {code}

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira