gianm commented on a change in pull request #9247: Add JoinableFactory
interface and use it in the query stack.
URL: https://github.com/apache/druid/pull/9247#discussion_r370758271
##########
File path:
processing/src/main/java/org/apache/druid/segment/join/Joinables.java
##########
@@ -52,4 +61,56 @@ public static boolean isPrefixedBy(final String columnName,
final String prefix)
{
return columnName.startsWith(prefix) && columnName.length() >
prefix.length();
}
+
+ /**
+ * Creates a Function that maps base segments to {@link HashJoinSegment} if
needed (i.e. if the number of join
+ * clauses is > 0). If mapping is not needed, this method will return {@link
Function#identity()}.
+ *
+ * @param clauses pre-joinable clauses
+ * @param joinableFactory factory for joinables
+ * @param cpuTimeAccumulator an accumulator that we will add CPU nanos to;
this is part of the function to encourage
+ * callers to remember to track metrics on CPU
time required for creation of Joinables
+ */
+ public static Function<Segment, Segment> createSegmentMapFn(
Review comment:
I'll add some. I'm thinking of adding tests that are a bit on the basic
side, because full-on tests require a lot of scaffolding similar to
HashJoinSegmentTest. I'm not sure if adding that here adds much value over the
tests that are already in HashJoinSegmentTest. So I'm planning to focus on
testing the functionality that HashJoinSegmentTest _doesn't_ test (error
conditions, special cases).
Let me know what you think. If you think I should add more tests beyond the
ones I'm about to add, please let me know.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]