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


##########
server/src/main/java/org/apache/druid/server/coordinator/rules/ProjectionPartialLoadMatcher.java:
##########
@@ -47,17 +59,24 @@ public abstract class ProjectionPartialLoadMatcher 
implements PartialLoadMatcher
   /**
    * Returns the sorted, deduped list of projection names from {@link 
DataSegment#getProjections()} that this matcher
    * selects. Returns an empty list when nothing matches (the segment exposes 
no projections, or no configured pattern
-   * intersects what the segment has).
+   * intersects what the segment has), which {@link #match} turns into a 
base-table load rather than a non-match.
    */
   protected abstract List<String> resolveProjectionNames(DataSegment segment);
 
+  /**
+   * Never returns {@code null}; see the class doc. Either the resolved 
projections, or a base-table load when none of
+   * them are present on {@code segment}.
+   */
   @Override
   @Nullable
   public MatchResult match(DataSegment segment, Map<String, Object> 
baseLoadSpec)
   {
     final List<String> resolved = resolveProjectionNames(segment);
     if (resolved.isEmpty()) {
-      return null;
+      return new MatchResult(

Review Comment:
   I thought this behavior made more sense for projection matching because a 
partial load rule is an intent to pre-warm data loading on historicals so that 
queries can be fast and projections can always be re-computed from the 'base' 
table if the desired projections are not present in the segment, so this change 
ensures that at least some user data is loaded that can satisfy user queries, 
and behaves better when used with a `CompositePartialLoadMatcher`, since a 
missing projection will not fail the whole match (this discussion 
https://github.com/apache/druid/pull/19791#discussion_r3682714313).



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