ehds commented on code in PR #5298:
URL: https://github.com/apache/calcite/pull/5298#discussion_r4140659743
##########
core/src/test/java/org/apache/calcite/test/RelMetadataTest.java:
##########
@@ -4895,6 +4899,141 @@ public void checkAllPredicatesAndTableSetOp(String sql)
{
assertNull(tableReferences);
}
+ @Test void testTableReferencesValues() {
Review Comment:
These tests use SQL or RelBuilder to construct the different Rel types being
tested, following the same approach as the existing tests.I've checked each
plan and its expected table references.
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdTableReferences.java:
##########
@@ -160,31 +157,40 @@ public Set<RelTableRef> getTableReferences(TableScan rel,
RelMetadataQuery mq) {
* references.
*/
public @Nullable Set<RelTableRef> getTableReferences(SetOp rel,
RelMetadataQuery mq) {
- return getTableReferences(rel.getInputs(), mq);
+ return getTableReferences(rel.getInputs(), ImmutableList.of(), mq);
}
/**
- * Table references from the relational inputs of a TableFunctionScan.
+ * Table references from TableFunctionScan.
*
- * <p>Returns an empty set if there are no inputs, and {@code null} if the
table
- * references of any input cannot be determined. Tables accessed internally
Review Comment:
The shared behavior is already documented at the class level, and this PR
also includes tables referenced by sub-queries in TableFunctionScan’s RexCall.
Therefore, I simplified the comment to keep it consistent with the other
methods.
--
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]