vikramahuja1001 commented on a change in pull request #3906:
URL: https://github.com/apache/carbondata/pull/3906#discussion_r480233177
##
File path:
integration/hive/src/main/java/org/apache/carbondata/hive/util/DataTypeUtil.java
##
@@ -64,13 +69,23 @@ public static DataType convertHiveTypeToCarbon(String type)
throws SQLException
return DataTypes.createArrayType(convertHiveTypeToCarbon(subType));
} else if (type.startsWith("map<")) {
String[] subType = (type.substring(type.indexOf("<") + 1,
type.indexOf(">"))).split(",");
+ for (int i = 0; i < subType.length; i++) {
+if (subType[i].startsWith("decimal")) {
+ subType[i] += ',' + subType[++i];
Review comment:
Use CarbonCommonConstants.COMMA instead of ','
##
File path:
integration/hive/src/main/java/org/apache/carbondata/hive/util/DataTypeUtil.java
##
@@ -64,13 +69,23 @@ public static DataType convertHiveTypeToCarbon(String type)
throws SQLException
return DataTypes.createArrayType(convertHiveTypeToCarbon(subType));
} else if (type.startsWith("map<")) {
String[] subType = (type.substring(type.indexOf("<") + 1,
type.indexOf(">"))).split(",");
+ for (int i = 0; i < subType.length; i++) {
+if (subType[i].startsWith("decimal")) {
+ subType[i] += ',' + subType[++i];
+ subType = (String[]) ArrayUtils.removeElement(subType, subType[i]);
+}
+ }
return DataTypes
.createMapType(convertHiveTypeToCarbon(subType[0]),
convertHiveTypeToCarbon(subType[1]));
} else if (type.startsWith("struct<")) {
String[] subTypes =
(type.substring(type.indexOf("<") + 1,
type.indexOf(">"))).split(",");
List structFieldList = new ArrayList<>();
- for (String subType : subTypes) {
+ for (int i = 0; i < subTypes.length; i++) {
+String subType = subTypes[i];
+if (subType.startsWith("decimal")) {
+ subType += ',' + subTypes[++i];
Review comment:
Use CarbonCommonConstants.COMMA
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