godfreyhe commented on a change in pull request #8468: 
[FLINK-12399][table][table-planner] Fix FilterableTableSource does not change 
after applyPredicate
URL: https://github.com/apache/flink/pull/8468#discussion_r334481923
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/PushFilterIntoTableSourceScanRule.scala
 ##########
 @@ -103,7 +104,18 @@ class PushFilterIntoTableSourceScanRule extends 
RelOptRule(
     val remainingPredicates = new util.LinkedList[Expression]()
     predicates.foreach(e => remainingPredicates.add(e))
 
-    val newRelOptTable = applyPredicate(remainingPredicates, relOptTable, 
relBuilder.getTypeFactory)
+    val newRelOptTable: FlinkRelOptTable = 
+      applyPredicate(remainingPredicates, relOptTable, 
relBuilder.getTypeFactory)
+    val newTableSource = 
newRelOptTable.unwrap(classOf[TableSourceTable[_]]).tableSource
+    val oldTableSource = 
relOptTable.unwrap(classOf[TableSourceTable[_]]).tableSource
+
+    if (remainingPredicates.size() > 0
 
 Review comment:
   I also think we should not check remainingPredicates here, because a 
filterable table source may accept all predicates and remainingPredicates is 
empty, however the developer forgets to change the explainSource.
   ps, `isFilterPushedDown` should be always true here, and we should also 
check this.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to