nihal0107 commented on a change in pull request #3936:
URL: https://github.com/apache/carbondata/pull/3936#discussion_r490843284



##########
File path: 
integration/hive/src/main/java/org/apache/carbondata/hive/util/HiveCarbonUtil.java
##########
@@ -171,15 +171,33 @@ public static CarbonTable getCarbonTable(Configuration 
tableProperties) throws S
       columns = columns + "," + partitionColumns;
       columnTypes = columnTypes + ":" + partitionColumnTypes;
     }
-    String[] columnTypeArray = 
HiveCarbonUtil.splitSchemaStringToArray(columnTypes);
-
+    String[][] validatedColumnsAndTypes = validateColumnsAndTypes(columns, 
columnTypes);
     CarbonTable carbonTable = CarbonTable.buildFromTableInfo(
         HiveCarbonUtil.getTableInfo(tableName, databaseName, tablePath,
-            sortColumns, columns.split(","), columnTypeArray, new 
ArrayList<>()));
+            sortColumns, validatedColumnsAndTypes[0],
+            validatedColumnsAndTypes[1], new ArrayList<>()));
     carbonTable.setTransactionalTable(false);
     return carbonTable;
   }
 
+  private static String[][] validateColumnsAndTypes(String columns, String 
columnTypes) {
+    String[] columnTypeArray = 
HiveCarbonUtil.splitSchemaStringToArray(columnTypes);

Review comment:
       In case of empty table some additional columns are getting added in the 
configuration. Here I have validated if any additional column and removed that.




----------------------------------------------------------------
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:
[email protected]


Reply via email to