You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2020/04/23 06:03:20 UTC

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

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



##########
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:
       for clean code styles, please replace `!index.validatePartitionInfo(partitions)` to `index.validatePartitionInfo(partitions)`

##########
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:
       replace `!validatePartitionInfo(partitions)` to `validatePartitionInfo(partitions)`

##########
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:
       make return true

##########
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:
       and at line number 758, replace `return found` to `return !found`




----------------------------------------------------------------
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:
users@infra.apache.org