[GitHub] [carbondata] kunal642 commented on a change in pull request #3906: [CARBONDATA-3968]Added test cases for hive read complex types and handled other issues

2020-09-08 Thread GitBox


kunal642 commented on a change in pull request #3906:
URL: https://github.com/apache/carbondata/pull/3906#discussion_r484718004



##
File path: 
processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/MapParserImpl.java
##
@@ -73,9 +73,12 @@ public ArrayObject parse(Object data) {
 
   @Override
   public ArrayObject parseRaw(Object data) {
-Object keyArray = ((Object[]) data)[0];
-Object valueArray = ((Object[]) data)[1];
-return new ArrayObject(new Object[]{child.parseRaw(keyArray), 
child.parseRaw(valueArray)});
+Object[] keyValuePairs = ((Object[]) data);

Review comment:
   okay





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




[GitHub] [carbondata] kunal642 commented on a change in pull request #3906: [CARBONDATA-3968]Added test cases for hive read complex types and handled other issues

2020-09-07 Thread GitBox


kunal642 commented on a change in pull request #3906:
URL: https://github.com/apache/carbondata/pull/3906#discussion_r484666349



##
File path: 
integration/hive/src/main/java/org/apache/carbondata/hive/util/DataTypeUtil.java
##
@@ -21,25 +21,31 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.carbondata.core.constants.CarbonCommonConstants;
 import org.apache.carbondata.core.metadata.datatype.DataType;
 import org.apache.carbondata.core.metadata.datatype.DataTypes;
 import org.apache.carbondata.core.metadata.datatype.StructField;
 
+import org.apache.commons.lang.ArrayUtils;
+
 public class DataTypeUtil {
 
   public static DataType convertHiveTypeToCarbon(String type) throws 
SQLException {
 if ("string".equalsIgnoreCase(type) || type.startsWith("char")) {
   return DataTypes.STRING;
-} else if ("varchar".equalsIgnoreCase(type)) {
+} else if (!type.startsWith("map<") && !type.startsWith("array<") && 
!type.startsWith("struct<")

Review comment:
   why map, struct, array check required?





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




[GitHub] [carbondata] kunal642 commented on a change in pull request #3906: [CARBONDATA-3968]Added test cases for hive read complex types and handled other issues

2020-09-07 Thread GitBox


kunal642 commented on a change in pull request #3906:
URL: https://github.com/apache/carbondata/pull/3906#discussion_r484666223



##
File path: 
processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/MapParserImpl.java
##
@@ -73,9 +73,12 @@ public ArrayObject parse(Object data) {
 
   @Override
   public ArrayObject parseRaw(Object data) {
-Object keyArray = ((Object[]) data)[0];
-Object valueArray = ((Object[]) data)[1];
-return new ArrayObject(new Object[]{child.parseRaw(keyArray), 
child.parseRaw(valueArray)});
+Object[] keyValuePairs = ((Object[]) data);

Review comment:
   What is the reason for this change?
   





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