ajantha-bhat commented on a change in pull request #3407: [CARBONDATA-3542] Support Map data type reading through Hive
URL:
https://github.com/apache/carbondata/pull/3407#discussion_r336892135
##########
File path: integration/hive/src/main/java/org/apache/carbondata/hive/CarbonDictionaryDecodeReadSupport.java
##########
@@ -206,6 +208,46 @@ private ArrayWritable createStruct(Object obj, CarbonColumn carbonColumn) throws
return null;
}
+ /**
+ * Create the Map data for Map Datatype
+ *
+ * @param obj
+ * @param carbonColumn
+ * @return
+ * @throws IOException
+ */
+ private ArrayWritable createMap(Object obj, CarbonColumn carbonColumn) throws IOException {
+ Object[] objArray = (Object[]) obj;
+ List<CarbonDimension> childCarbonDimensions = null;
+ CarbonDimension mapDimension = null;
+ List<ArrayWritable> writablesList = new ArrayList<>();
+ if (carbonColumn.isDimension() && carbonColumn.getColumnSchema().getNumberOfChild() > 0) {
+ childCarbonDimensions = ((CarbonDimension) carbonColumn).getListOfChildDimensions();
+ mapDimension = childCarbonDimensions.get(0);
+ }
+ if (null != mapDimension) {
+ childCarbonDimensions = mapDimension.getListOfChildDimensions();
Review comment:
This part of code is little confusing. can you add comments ?
mapDimension itself extracted from childCarbonDimensions.
may be in 225 line, remove childCarbonDimensions and fill mapDimension directly ? so it is more easy to understand.
----------------------------------------------------------------
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:
[hidden email]
With regards,
Apache Git Services