[GitHub] [carbondata] Indhumathi27 commented on a change in pull request #3714: [CARBONDATA-3773] Skip Validate partition info in Indexserver count star flow

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

[GitHub] [carbondata] Indhumathi27 commented on a change in pull request #3714: [CARBONDATA-3773] Skip Validate partition info in Indexserver count star flow

GitBox

Indhumathi27 commented on a change in pull request #3714:
URL: https://github.com/apache/carbondata/pull/3714#discussion_r413562634



##########
File path: core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.java
##########
@@ -740,7 +740,10 @@ protected boolean useMinMaxForExecutorPruning(FilterResolverIntf filterResolverI
     return prune(filterExp, filterExecuter, segmentProperties);
   }
 
-  private boolean validatePartitionInfo(List<PartitionSpec> partitions) {
+  public boolean validatePartitionInfo(List<PartitionSpec> partitions) {
+    if (memoryDMStore.getRowCount() == 0) {
+      return false;

Review comment:
       done

##########
File path: core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockIndex.java
##########
@@ -613,6 +613,13 @@ public long getRowCount(Segment segment, List<PartitionSpec> partitions) {
         taskSummaryDMStore.getIndexRow(getTaskSummarySchema(), 0).getLong(TASK_ROW_COUNT);
     if (totalRowCount == 0) {
       Map<String, Long> blockletToRowCountMap = new HashMap<>();
+      // if it has partitioned index but there is no partitioned information stored, it means
+      // partitions are dropped so return empty list.
+      if (partitions != null) {
+        if (!validatePartitionInfo(partitions)) {

Review comment:
       done

##########
File path: core/src/main/java/org/apache/carbondata/core/index/TableIndex.java
##########
@@ -595,6 +595,30 @@ public void onEvent(Event event, OperationContext opContext) {
       throws IOException {
     List<Segment> segments = getCarbonSegments(allsegments);
     Map<String, Long> blockletToRowCountMap = new HashMap<>();
+    for (Segment segment : segments) {
+      List<CoarseGrainIndex> indexes = defaultIndex.getIndexFactory().getIndexes(segment);
+      for (CoarseGrainIndex index : indexes) {
+        if (null != partitions) {
+          // if it has partitioned index but there is no partitioned information stored, it means
+          // partitions are dropped so return empty list.
+          if (!index.validatePartitionInfo(partitions)) {

Review comment:
       done




----------------------------------------------------------------
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]