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

    https://github.com/apache/flink/pull/1827#discussion_r57173349
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/AbstractTableEnvironment.scala
 ---
    @@ -0,0 +1,86 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.flink.api.table
    +
    +import org.apache.flink.api.java.DataSet
    +import org.apache.flink.api.table.expressions.Expression
    +import org.apache.flink.api.table.plan.TranslationContext
    +import org.apache.flink.api.table.plan.schema.{DataSetTable, TableTable}
    +
    +class AbstractTableEnvironment {
    +
    +  private[flink] val config = new TableConfig()
    +
    +  /**
    +   * Returns the table config to define the runtime behavior of the Table 
API.
    +   */
    +  def getConfig = config
    +
    +  /**
    +   * Registers a Table under a unique name, so that it can be used in SQL 
queries.
    +   * @param name the Table name
    +   * @param table the Table to register
    +   */
    +  def registerTable[T](name: String, table: Table): Unit = {
    +    val tableTable = new TableTable(table.getRelNode())
    +    TranslationContext.registerTable(tableTable, name)
    +  }
    +
    +  /**
    +   * Retrieve a registered Table.
    +   * @param tableName the name under which the Table has been registered
    +   * @return the Table object
    +   */
    +  @throws[TableException]
    +  def scan(tableName: String): Table = {
    +    if (TranslationContext.isRegistered(tableName)) {
    +      val relBuilder = TranslationContext.getRelBuilder
    +      relBuilder.scan(tableName)
    +      new Table(relBuilder.build(), relBuilder)
    +    }
    +    else {
    +      throw new TableException(s"Table \'$tableName\' was not found in the 
registry.")
    +    }
    +  }
    +
    +  def registerUniqueNameDataSet[T](name: String, dataset: DataSet[T]): 
Unit = {
    --- End diff --
    
    call this `registerDataSetInternal` and make it private?


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