[GitHub] akashrn5 commented on a change in pull request #3121: [CARBONDATA-3287]Remove the validation for same schema in a location and fix drop datamap issue

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] akashrn5 commented on a change in pull request #3121: [CARBONDATA-3287]Remove the validation for same schema in a location and fix drop datamap issue

GitBox
akashrn5 commented on a change in pull request #3121: [CARBONDATA-3287]Remove the validation for same schema in a location and fix drop datamap issue
URL: https://github.com/apache/carbondata/pull/3121#discussion_r254154409
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/scan/model/QueryModel.java
 ##########
 @@ -209,13 +215,40 @@ private static void setDimAndMsrColumnNode(FilterProcessVO processVO, ColumnExpr
       if (null != isFilterMeasures) {
         isFilterMeasures[msr.getOrdinal()] = true;
       }
-    } else {
+    } else if (null != CarbonUtil.findDimension(processVO.getImplicitDimensions(), columnName)) {
       // check if this is an implicit dimension
-      dim = CarbonUtil
-          .findDimension(processVO.getImplicitDimensions(), columnName);
+      dim = CarbonUtil.findDimension(processVO.getImplicitDimensions(), columnName);
       col.setCarbonColumn(dim);
       col.setDimension(dim);
       col.setDimension(true);
+    } else {
+      // in case of sdk or fileformat, there can be chance that each carbondata file may have
+      // different schema, so every segment properties will have dims and measures based on
+      // corresponding segment. So the filter column may not be present in it. so generate the
+      // dimension and measure based on the info present in column expression
+      col.setDimension(isDimensionFromExpression);
+      col.setMeasure(isMeasureFromExpression);
+      if (isDimensionFromExpression) {
+        col.setDimension(new CarbonDimension(col.getCarbonColumn().getColumnSchema(),
 
 Review comment:
   Column expression will have the CarbonColumn, but in this method, first we do reset, which set the dimension and measure and boolean values to null, so if column is not present it will not able to get it again, so im constructing the dimension or measure based on boolean flag in expression from CarbonColumn

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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