Github user KurtYoung commented on a diff in the pull request:
https://github.com/apache/flink/pull/3520#discussion_r106321885
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/sources/ProjectableTableSource.scala
---
@@ -24,7 +24,7 @@ package org.apache.flink.table.sources
*
* @tparam T The return type of the [[ProjectableTableSource]].
*/
-trait ProjectableTableSource[T] {
+trait ProjectableTableSource[T] extends TableSource[T] {
--- End diff --
It's because i want to unify the PushProjectIntoScan rule codes for both
batch and stream mode. And once we push down project into table source, we not
only should create a new TableScan instance, but also a new TableSource
instance. The codes are like:
```
val newTableSource = originTableSource.projectFields(usedFields)
// create a new scan with the new TableSource instance
val newScan = scan.copy(scan.getTraitSet, newTableSource)
```
At first the `projectFields` method returned `ProjectableTableSource` which
is not a `TableSource`, so i let `ProjectableTableSource` inherit from
`TableSource`. But i just noticed we can just let `projectFields` return one
`TableSource`, and problem resolved.
Will change this.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---