clintropolis commented on code in PR #19460:
URL: https://github.com/apache/druid/pull/19460#discussion_r3353800447


##########
processing/src/main/java/org/apache/druid/segment/IndexIO.java:
##########
@@ -1080,6 +1126,63 @@ private Map<String, Supplier<BaseColumnHolder>> 
readProjectionColumns(
       return projectionColumns;
     }
 
+    /**
+     * Read the per-column data for cluster group {@code groupIndex}. Mirrors 
{@link #readProjectionColumns} but
+     * with the dictionary-id-tuple smoosh prefix {@code 
__base$<id0>_<id1>...<idK>/<col>}; the column set
+     * excludes clustering columns (constants, injected at query time).
+     */
+    private Map<String, Supplier<BaseColumnHolder>> readClusterGroupColumns(
+        SegmentFileMetadata metadata,
+        ClusteredValueGroupsBaseTableSchema summary,
+        int groupIndex,
+        SegmentFileMapper segmentFileMapper,
+        long intervalStartMillis,
+        boolean lazy,
+        SegmentLazyLoadFailCallback loadFailed
+    ) throws IOException
+    {
+      final TableClusterGroupSpec spec = 
summary.getClusterGroups().get(groupIndex);
+      final List<Integer> clusteringValueIds = spec.getClusteringValueIds();
+      final String timeColumnName = summary.getTimeColumnName();
+      final boolean renameTime = 
!ColumnHolder.TIME_COLUMN_NAME.equals(timeColumnName);
+      final Map<String, Supplier<BaseColumnHolder>> groupColumns = new 
LinkedHashMap<>();
+
+      for (String column : summary.getGroupColumnNames()) {
+        final String smooshName = 
Projections.getClusterGroupSegmentInternalFileName(clusteringValueIds, column);
+        final ByteBuffer colBuffer = segmentFileMapper.mapFile(smooshName);

Review Comment:
   this didn't really matter because mapFile just returns null if a file 
doesn't exist and the descriptor would be null too so we hit the continue 
block, however the code reads smoother if we just get the descriptor first and 
bail before calling mapFile so i went ahead and changed it



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to