flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-3727] Embedded streaming SQL projection...
Date Wed, 20 Apr 2016 19:38:40 GMT
Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1917#discussion_r60473805
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/TableEnvironment.scala
---
    @@ -98,8 +98,42 @@ abstract class TableEnvironment(val config: TableConfig) {
     
         checkValidTableName(name)
     
    -    val tableTable = new TableTable(table.getRelNode)
    -    registerTableInternal(name, tableTable)
    +    table.tableEnv match {
    +      case e: BatchTableEnvironment =>
    +        val tableTable = new TableTable(table.getRelNode)
    +        registerTableInternal(name, tableTable)
    +      case e: StreamTableEnvironment =>
    +        val sTableTable = new TransStreamTable(table.getRelNode, true)
    +        tables.add(name, sTableTable)
    +    }
    +
    +  }
    +
    +  protected def registerStreamTableInternal(name: String, table: AbstractTable): Unit
= {
    +
    +    if (isRegistered(name)) {
    +      throw new TableException(s"Table \'$name\' already exists. " +
    +        s"Please, choose a different name.")
    +    } else {
    +      tables.add(name, table)
    +    }
    +  }
    +
    +  /**
    +   * Replaces a registered Table with another Table under the same name.
    +   * We use this method to replace a [[org.apache.flink.api.table.plan.schema.DataStreamTable]]
    +   * with a [[org.apache.calcite.schema.TranslatableTable]].
    +   *
    +   * @param name
    +   * @param table
    +   */
    +  protected def replaceRegisteredStreamTable(name: String, table: AbstractTable): Unit
= {
    --- End diff --
    
    rename to `replaceRegisteredTable()` since it is not specific for stream tables?


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

Mime
View raw message