Github user lincoln-lil commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3829#discussion_r136325581
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/queryConfig.scala
 ---
    @@ -19,9 +19,21 @@
     package org.apache.flink.table.api
     
     import _root_.java.io.Serializable
    +
     import org.apache.flink.api.common.time.Time
     
    -class QueryConfig private[table] extends Serializable {}
    +class QueryConfig private[table] extends Serializable {
    +}
    +
    +object QueryConfig {
    +  def getQueryConfigFromTableEnv(tableEnv: TableEnvironment): QueryConfig 
= {
    --- End diff --
    
    The `queryConfig` method in `StreamTableEnvironment` does the same thing as 
the overridden one, just because the class return type, this makes the code 
duplicated.
    
    There's another subclass `MockTableEnvironment`,  so the default method in 
`TableEnvironment` may be
    
    ```
    private[flink] def queryConfig: QueryConfig = this match {
    case _: BatchTableEnvironment => new BatchQueryConfig
    case _: StreamTableEnvironment => new StreamQueryConfig
    case _ => ???
    }
    ```
    
    If we decide to add an `queryConfig` method, I suggest make it abstract and 
 implements in every subclass.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to