[
https://issues.apache.org/jira/browse/IMPALA-11645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17621269#comment-17621269
]
ASF subversion and git services commented on IMPALA-11645:
----------------------------------------------------------
Commit 50944811351af142baa75ca0742da58f92407f6d in impala's branch
refs/heads/master from Daniel Becker
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=509448113 ]
IMPALA-11645: Remove PrintThriftEnum functions in debug-utils.cc
Before IMPALA-5690 we implemented operator<< for Thrift enums in Impala
code. These functions printed the names of the enums.
Then we upgraded to Thrift 0.9.3, but that release included THRIFT-2067,
which implemented operator<< for Thrift enums, but printed the number
value of enums instead of their names. To preserve the old behaviour in
Impala, we renamed our own implementations of operator<< to
PrintThriftEnum, a function that we defined for each Thrift enum we
used, and which returned a string with the names - not the numbers - of
the enums.
After upgrading Thrift to a version that included THRIFT-3921 (any
version starting from 0.11.0), these PrintThriftEnum functions are no
longer necessary as the operator<< provided by Thrift now prints the
names of enums, which is the behaviour we want.
This change removes all PrintThriftEnum functions. At the call sites
where the result of the function call was inserted into a stream, now the
enum is inserted directly (invoking the operator<< provided by Thrift).
At the call sites where a string object is expected, we replaced the
call to PrintThriftEnum with a call to a new function template,
PrintValue(), which converts any object for which operator<< is defined
to a string.
Change-Id: Ie36f6f0f032f3f5c7596929a1eccb80ff16fcd83
Reviewed-on: http://gerrit.cloudera.org:8080/19118
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> Remove PrintThriftEnum functions in debug-utils.cc
> --------------------------------------------------
>
> Key: IMPALA-11645
> URL: https://issues.apache.org/jira/browse/IMPALA-11645
> Project: IMPALA
> Issue Type: Improvement
> Reporter: Daniel Becker
> Assignee: Daniel Becker
> Priority: Major
>
> Before IMPALA-5690 we implemented operator<< for Thrift enums in Impala code.
> These functions printed the names of the enums.
> Then we upgraded to Thrift 0.9.3, but that release included THRIFT-2067,
> which implemented operator<< for Thrift enums, but printed the number value
> of enums instead of their names. To preserve the old behaviour in Impala, we
> renamed our own implementations of operator<< to PrintThriftEnum, a function
> that we defined for each Thrift enum we used, and which returned a string
> with the names - not the numbers - of the enums.
> After upgrading Thrift to a version that included THRIFT-3921 (any version
> starting from 0.11.0), these PrintThriftEnum functions are no longer
> necessary as the operator<< provided by Thrift now prints the names of enums,
> which is the behaviour we want.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]