[ 
https://issues.apache.org/jira/browse/HIVE-27396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17754198#comment-17754198
 ] 

Joe McDonnell commented on HIVE-27396:
--------------------------------------

Thanks for the review, [~dengzh]!

> Use -strict argument for Thrift code generation to prevent compatibility 
> issues
> -------------------------------------------------------------------------------
>
>                 Key: HIVE-27396
>                 URL: https://issues.apache.org/jira/browse/HIVE-27396
>             Project: Hive
>          Issue Type: Improvement
>          Components: Build Infrastructure
>    Affects Versions: 4.0.0
>            Reporter: Joe McDonnell
>            Assignee: Joe McDonnell
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>
> When generating code, the Thrift compiler has a "-strict" option that errors 
> out for certain warnings. Specifically, it errors out when there are implicit 
> field keys:
> {noformat}
>         pwarning(1, "No field key specified for %s, resulting protocol may 
> have conflicts or not be backwards compatible!\n", $6);
>         if (g_strict >= 192) {
>           yyerror("Implicit field keys are deprecated and not allowed with 
> -strict");
>           exit(1);
>         }{noformat}
> [https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/thrifty.yy#L824-L828]
> This is a warning that has been introduced in the past (see HIVE-27103 and 
> HIVE-20365)
> I think that it would be useful to add "-strict" to the arguments for Thrift 
> code generation. It would prevent the introduction of new compatibility 
> issues, because the command would fail rather than generating a warning that 
> is easy to miss.
> The current Thrift files already work with -strict, so this should be a 
> painless thing.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to