[ 
https://issues.apache.org/jira/browse/AVRO-2923?focusedWorklogId=642369&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-642369
 ]

ASF GitHub Bot logged work on AVRO-2923:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Aug/21 14:27
            Start Date: 26/Aug/21 14:27
    Worklog Time Spent: 10m 
      Work Description: RyanSkraba commented on pull request #949:
URL: https://github.com/apache/avro/pull/949#issuecomment-906462820


   Hello!  Since this PR has been approved and we haven't gotten master fixed, 
let's merge it!  Thanks for the contribution, you should see this fix in 
1.11.0.  AVRO-3187 is open for the build failure.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 642369)
    Remaining Estimate: 0h
            Time Spent: 10m

> GenericDatum::logicalType() API should return the logical type corresponing 
> to one of the constituent types of the union
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-2923
>                 URL: https://issues.apache.org/jira/browse/AVRO-2923
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: c++
>    Affects Versions: 1.10.0
>            Reporter: Yang Xu
>            Assignee: Yang Xu
>            Priority: Major
>             Fix For: 1.11.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> According to the avro document, GenericDatum::logicalType() API should behave 
> Just like GenericDatum::type() or GenericDatum::value() APIs to return the 
> logical type corresponing to one of the constituent types of the union When 
> it was a Union type.
> {code:cpp}
> inline Type GenericDatum::type() const {
>     return (type_ == AVRO_UNION) ?
> #if __cplusplus >= 201703L
>         std::any_cast<GenericUnion>(&value_)->datum().type() :
> #else
>         boost::any_cast<GenericUnion>(&value_)->datum().type() :
> #endif
>         type_;
> }
> template<typename T> T& GenericDatum::value() {
>     return (type_ == AVRO_UNION) ?
> #if __cplusplus >= 201703L
>         std::any_cast<GenericUnion>(&value_)->datum().value<T>() :
>         *std::any_cast<T>(&value_);
> #else
>         boost::any_cast<GenericUnion>(&value_)->datum().value<T>() :
>         *boost::any_cast<T>(&value_);
> #endif
> }
> {code}
> while logicalType api was like this: 
> {code:cpp}
> inline LogicalType GenericDatum::logicalType() const {
>     return logicalType_;
> }
> {code}
> it should also do the GenericUnion check



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to