hddong commented on a change in pull request #1574:
URL: https://github.com/apache/incubator-hudi/pull/1574#discussion_r421365870



##########
File path: hudi-cli/src/main/java/org/apache/hudi/cli/commands/SparkMain.java
##########
@@ -82,17 +82,17 @@ public static void main(String[] args) throws Exception {
         break;
       case IMPORT:
       case UPSERT:
-        assert (args.length >= 12);
+        assert (args.length >= 13);
         String propsFilePath = null;
-        if (!StringUtils.isNullOrEmpty(args[11])) {
-          propsFilePath = args[11];
+        if (!StringUtils.isNullOrEmpty(args[12])) {
+          propsFilePath = args[12];
         }
         List<String> configs = new ArrayList<>();
-        if (args.length > 12) {
-          configs.addAll(Arrays.asList(args).subList(12, args.length));
+        if (args.length > 13) {
+          configs.addAll(Arrays.asList(args).subList(13, args.length));
         }
-        returnCode = dataLoad(jsc, command, args[1], args[2], args[3], 
args[4], args[5], args[6],
-            Integer.parseInt(args[7]), args[8], args[9], 
Integer.parseInt(args[10]), propsFilePath, configs);
+        returnCode = dataLoad(jsc, command, args[3], args[4], args[5], 
args[6], args[7], args[8],

Review comment:
       > **Please note that I am not talking about you here**. But these array 
indexes containing numbers are very ugly and unreadable. We should think of a 
way to improve it.
   > 
   > We should parse all parameters and it is best to do:
   > 
   > 1. Define appropriate variables to store each parameter to improve the 
readability of the code;
   > 2. Refactor it, yes, the parse of the parameters should be 
order-independent;
   > 
   > WDYT? @hddong @vinothchandar
   
   Agree, and have a exist PR(#1174) by @pratyakshsharma




----------------------------------------------------------------
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.

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


Reply via email to