asolimando commented on code in PR #3264:
URL: https://github.com/apache/calcite/pull/3264#discussion_r1229967418
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java:
##########
@@ -505,6 +509,29 @@ public static RelMetadataQuery instance() {
}
}
+ /**
+ * Returns the
+ * {@link BuiltInMetadata.ForeignKeys#getForeignKeys(boolean)}
+ * statistic.
+ *
+ * @param rel the relational expression
+ * @param ignoreNulls if true, ignore null values when determining
+ * whether the keys are foreign keys
+ *
+ * @return set of keys, or empty set if this information cannot
be determined
+ * (whereas empty set indicates definitely no keys at all)
+ */
+ public ImmutableBitSet getForeignKeys(RelNode rel, boolean ignoreNulls) {
+ for (;;) {
+ try {
+ return foreignKeysHandler.getForeignKeys(rel, this, ignoreNulls);
+ } catch (MetadataHandlerProvider.NoHandler e) {
+ foreignKeysHandler =
+ revise(BuiltInMetadata.ForeignKeys.Handler.class);
Review Comment:
No need to split the line I think:
```suggestion
foreignKeysHandler =
revise(BuiltInMetadata.ForeignKeys.Handler.class);
```
--
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]