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 can check remainingPredicates here, because a filterable
table source may accept all predicates but the explainSource does not been
changed.
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:
[email protected]
With regards,
Apache Git Services