You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by fhueske <gi...@git.apache.org> on 2017/03/15 08:26:31 UTC

[GitHub] flink pull request #3409: [flink-5570] [Table API & SQL]Support register ext...

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

    https://github.com/apache/flink/pull/3409#discussion_r106024978
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala ---
    @@ -246,6 +251,36 @@ abstract class TableEnvironment(val config: TableConfig) {
       }
     
       /**
    +    * Registers a [[ExternalCatalog]] under a unique name in the TableEnvironment's catalog.
    +    * The databases and tables in the registered external catalog can be referenced in SQL queries.
    +    *
    +    * @param name            The name under which the externalCatalog will be registered.
    +    * @param externalCatalog The externalCatalog to register.
    +    */
    +  def registerExternalCatalog(name: String, externalCatalog: ExternalCatalog): Unit = {
    +    if (this.externalCatalogs.contains(name)) {
    +      throw new ExternalCatalogAlreadyExistException(name)
    +    }
    +    this.externalCatalogs.put(name, externalCatalog)
    +    // create an external catalog calicte schema, register it on the root schema
    +    ExternalCatalogSchema.create(rootSchema, name, externalCatalog)
    +  }
    +
    +  /**
    +    * Gets a registered [[ExternalCatalog]] by name
    +    *
    +    * @param name The name under which the externalCatalog was previous registered.
    +    * @return the externalCatalog found by name
    +    */
    +  def getRegisteredExternalCatalog(name: String): ExternalCatalog = {
    --- End diff --
    
    Should this be a public method or will it only be used internally?


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