You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Joe McDonnell (Jira)" <ji...@apache.org> on 2023/05/31 23:05:00 UTC
[jira] [Created] (HIVE-27396) Use -strict argument for Thrift code generation to prevent compatibility issues
Joe McDonnell created HIVE-27396:
------------------------------------
Summary: 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
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)