xushiyan commented on code in PR #7068:
URL: https://github.com/apache/hudi/pull/7068#discussion_r1008745534


##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncConfig.java:
##########
@@ -108,45 +108,45 @@ public static class HiveSyncConfigParams {
             + "instead of org.apache.hudi package. Use this when you are in 
the process of migrating from "
             + "com.uber.hoodie to org.apache.hudi. Stop using this after you 
migrated the table definition to "
             + "org.apache.hudi input format.")
-    public Boolean usePreApacheInputFormat;
+    public boolean usePreApacheInputFormat;
     @Deprecated
-    @Parameter(names = {"--use-jdbc"}, description = "Hive jdbc connect url")
-    public Boolean useJdbc;
+    @Parameter(names = {"--use-jdbc"}, description = "Hive jdbc connect url", 
arity = 1)
+    public Boolean useJdbc = true;
     @Parameter(names = {"--metastore-uris"}, description = "Hive metastore 
uris")
     public String metastoreUris;
     @Parameter(names = {"--sync-mode"}, description = "Mode to choose for Hive 
ops. Valid values are hms,glue,jdbc and hiveql")
     public String syncMode;
-    @Parameter(names = {"--auto-create-database"}, description = "Auto create 
hive database")
-    public Boolean autoCreateDatabase;
+    @Parameter(names = {"--auto-create-database"}, description = "Auto create 
hive database", arity = 1)
+    public boolean autoCreateDatabase = true;
     @Parameter(names = {"--ignore-exceptions"}, description = "Ignore hive 
exceptions")
-    public Boolean ignoreExceptions;
+    public boolean ignoreExceptions;

Review Comment:
   @xicm this leads to inconsistency: some boolean args are `arity=0` and some 
`arity=1`, which will cause confusion and won't be a good usage pattern. 
Besides, this basically ties usage with default values: what if an option 
default change from true to false, then we need to change arity and it will 
break. Please avoid any usage change in this PR and only tackle the NPE 
problem. As i mentioned, this is an existing problem and should be addressed 
separately and with more user-experience consideration.



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to