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

    https://github.com/apache/flink/pull/3409#discussion_r107009220
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
 ---
    @@ -178,4 +178,32 @@ class BatchTableEnvironment(
     
         registerTableFunctionInternal[T](name, tf)
       }
    +
    +  /**
    +    * Scans a table from registered temporary tables and registered 
catalogs.
    +    *
    +    * The table to scan must be registered in the TableEnvironment or
    +    * must exist in registered catalog in the TableEnvironment.
    +    *
    +    * Example:
    +    *
    +    * to scan a registered temporary table
    +    * {{{
    +    *   val tab: Table = tableEnv.scan("tableName")
    +    * }}}
    +    *
    +    * to scan a table from a registered catalog
    +    * {{{
    +    *   val tab: Table = tableEnv.scan("catalogName.dbName.tableName")
    +    * }}}
    +    *
    +    * @param tablePath The path of the table to scan.
    +    * @throws TableException if no table is found using the given table 
path.
    +    * @return The resulting [[Table]].
    +    */
    +  @throws[TableException]
    +  def scan(tablePath: String): Table = {
    --- End diff --
    
    Initially, @beyond1920 had added a `scan(catalog: String, db: String, 
table: String)` method to the root `TableEnvironment` in addition to the 
`scan(table: String)` method. 
    
    I had suggested to just use a single varargs method, but since we have Java 
and Scala environments the varargs method needed to go into the specific 
`TableEnvironment` implementations. However, I forgot that the Java 
environments are also implemented in Scala. I assume we cannot define Java 
varargs for those. That's probably we we ended up with the parsing approach. 
Not sure if this is better than having two methods in the root 
`TableEnvironment`.


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