You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/03/18 22:03:14 UTC

[GitHub] [druid] maytasm commented on a change in pull request #10948: If ingested data has sparse columns, the ingested data with forceGuaranteedRollup=true can result in imperfect rollup and final dimension ordering can be different from dimensionSpec ordering in the ingestionSpec

maytasm commented on a change in pull request #10948:
URL: https://github.com/apache/druid/pull/10948#discussion_r597272564



##########
File path: processing/src/main/java/org/apache/druid/segment/IndexMerger.java
##########
@@ -106,6 +118,41 @@
       return null;
     }
 
+    if (isDimensionOrderingValid(indexes, orderingCandidate)) {
+      return ImmutableList.copyOf(orderingCandidate);
+    } else {
+      log.info("Indexes have incompatible dimension orders, try falling back on dimension ordering from ingestionSpec");
+      // Check if there is a valid dimension ordering in the ingestionSpec to fall back on
+      if (dimensionsSpec == null || CollectionUtils.isNullOrEmpty(dimensionsSpec.getDimensionNames())) {
+        log.info("Cannot fall back on dimension ordering from ingestionSpec as it does not exist");
+        return null;
+      }
+      List<String> candidate = dimensionsSpec.getDimensionNames();

Review comment:
       Good point. From the Guava docs, seems like "The returned list is a transformed view of fromList; changes to fromList will be reflected in the returned list and vice versa." and "To avoid lazy evaluation when the returned list doesn't need to be a view, copy the returned list into a new list of your choosing."
   
   Changed this to make a copy of the returned list from `dimensionsSpec.getDimensionNames()`




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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org