walterddr commented on code in PR #10006: URL: https://github.com/apache/pinot/pull/10006#discussion_r1052706976
########## pinot-core/src/main/java/org/apache/pinot/core/operator/combine/function/CombineFunction.java: ########## @@ -0,0 +1,32 @@ +package org.apache.pinot.core.operator.combine.function; + +import org.apache.pinot.core.operator.blocks.results.BaseResultsBlock; + + +public interface CombineFunction<T extends BaseResultsBlock> { + + /** + * Merges a results block into the main mergeable results block. + * <p>NOTE: {@code blockToMerge} should contain the result for a segment without any exception. The errored segment + * result is already handled. + * + * @param mergedBlock The block that accumulates previous results. It should be modified to add the information of the + * other block. + * @param blockToMerge The new block that needs to be merged into the mergedBlock. + */ + void mergeResultsBlocks(T mergedBlock, T blockToMerge); + + /** + * Can be overridden for early termination. The input results block might not be mergeable. + */ + default boolean isQuerySatisfied(T resultsBlock) { + return false; + } + + /** + * Converts the given results block into a mergeable results block if necessary. + */ + default T convertToMergeableBlock(T resultsBlock) { Review Comment: adjusted the javadoc. basically it is only called for the first argument to the `mergeResultsBlocks` function -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org