Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3118#discussion_r97098892
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/TableFunction.scala
 ---
    @@ -99,27 +98,26 @@ abstract class TableFunction[T] extends 
UserDefinedFunction {
     
       // 
----------------------------------------------------------------------------------------------
     
    -  private val rows: util.ArrayList[T] = new util.ArrayList[T]()
    -
       /**
         * Emit an output row.
         *
         * @param row the output row
         */
       protected def collect(row: T): Unit = {
    -    // cache rows for now, maybe immediately process them further
    -    rows.add(row)
    +    collector.collect(row)
       }
     
    -  /**
    -    * Internal use. Get an iterator of the buffered rows.
    -    */
    -  def getRowsIterator = rows.iterator()
    +  // 
----------------------------------------------------------------------------------------------
    +
    +  /** The code generated collector used to emit row. */
    +  private var collector: Collector[T] = _
     
       /**
    -    * Internal use. Clear buffered rows.
    +    * Internal use. Sets the current collector.
         */
    -  def clear() = rows.clear()
    +  def setCollector(collector: Collector[T]): Unit = {
    --- End diff --
    
    Could we set this to `private[flink]`? Than we could at least hide in Scala 
API. It should still be accessible for Java runtime. And maybe also final?


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

Reply via email to