jon-wei commented on a change in pull request #9384: Add join prefix
duplicate/shadowing check
URL: https://github.com/apache/druid/pull/9384#discussion_r383608320
##########
File path:
processing/src/main/java/org/apache/druid/segment/join/Joinables.java
##########
@@ -114,4 +118,37 @@ public static boolean isPrefixedBy(final String
columnName, final String prefix)
);
}).collect(Collectors.toList());
}
+
+ public static void checkPreJoinableClausesForDuplicatesAndShadowing(
+ final List<PreJoinableClause> preJoinableClauses
+ )
+ {
+ List<String> prefixes = new ArrayList<>();
+ for (PreJoinableClause clause : preJoinableClauses) {
+ prefixes.add(clause.getPrefix());
+ }
+
+ checkPrefixesForDuplicatesAndShadowing(prefixes);
Review comment:
I think we'd typically have a small number of clauses (one per JOIN
statement in the query), I did some brief benchmarks with a radix tree approach
and found it was significantly slower on the 6 prefix test I tried
(https://github.com/jon-wei/druid/tree/join_prefix_check2)
I think this is fine for now, I added a comment about the naive approach
----------------------------------------------------------------
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]