You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "egalpin (via GitHub)" <gi...@apache.org> on 2023/06/09 19:54:30 UTC

[GitHub] [pinot] egalpin commented on a diff in pull request #10880: Fixes #10875 - build forward index if isSorted only results from autogenerated nodict column

egalpin commented on code in PR #10880:
URL: https://github.com/apache/pinot/pull/10880#discussion_r1224708964


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/ForwardIndexHandler.java:
##########
@@ -359,7 +359,8 @@ private boolean shouldDisableDictionary(String column, ColumnMetadata existingCo
     }
 
     // Sorted columns should always have a dictionary.
-    if (existingColumnMetadata.isSorted()) {
+    if (existingColumnMetadata.isSorted()
+        && !(existingColumnMetadata.getCardinality() == 1 && existingColumnMetadata.isAutoGenerated())) {

Review Comment:
   columns which are auto-generated as part of segment reload after adding a new column always have `cardinality: 1` because the default null value for the column is the sole value in the segment.
   
   When columns have cardinality of 1, they are inferred to be sorted.  It's possible a better fix exists where the noDictColumns can be referenced at the time that "isSorted" is determined. 



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

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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