korlov42 commented on code in PR #4430:
URL: https://github.com/apache/calcite/pull/4430#discussion_r2160905994


##########
core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java:
##########
@@ -529,9 +529,6 @@ private boolean inputContainsSubQueryTables(Project 
project, RelNode input) {
 
     Set<List<String>> subQueryTables = inputSubQueryTablesCollector.tables();
 
-    assert subQueryTables.isEmpty() || subQueryTables.size() == 1

Review Comment:
   I feel like we should remove `inputContainsSubQueryTables`. 
   
   First, it collects all tables from TableScan nodes in all scalar subqueries 
in given project list. Then, it collects all the tables from input of the 
project node. Finally, it checks if these two sets intersect. In other words, 
this method returns `true` if any correlated subquery has the same table as 
source as input of the project this sub-query resides. Later, we will collect 
extra fields only in the case if there was match.
   
   This doesn't make any sense to me.



-- 
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]

Reply via email to