julianhyde commented on a change in pull request #1397: [CALCITE-3115] Cannot
add JdbcRules which have different JdbcConvention to same VolcanoPlanner's
RuleSet.
URL: https://github.com/apache/calcite/pull/1397#discussion_r316976211
##########
File path: core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcRules.java
##########
@@ -262,6 +263,17 @@ private JdbcRules() {
this(clazz, (Predicate<R>) predicate, in, out, relBuilderFactory,
description);
}
+
+ /**
+ * Creates name for child JdbcConverter rules in format:
+ * RuleName(out:CONVENTION_NAME)
+ *
+ * @param out output convention
+ * @return rule name
+ */
+ protected static String getRuleName(Class<?> clazz, JdbcConvention out) {
+ return String.format(Locale.ROOT, "%s(out:%s)", clazz.getSimpleName(),
out);
+ }
Review comment:
Well, exactly. If there is only one instance of convention C, you can only
have one instance of a rule that uses C. But if there are two instances of the
rule that use c1 and c2, you have to include c1 and c2 in the name of those
rules so that their names are different.
Maybe ElasticSearch convention should NOT be a singleton. I suppose we'll
run into the bug when someone wants to run a federated query across more than
one ElasticSearch database.
----------------------------------------------------------------
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