dawidwys commented on a change in pull request #8006: [FLINK-11068][table] Convert the API classes of *Table to interfaces URL: https://github.com/apache/flink/pull/8006#discussion_r266767404
########## File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/Table.java ########## @@ -0,0 +1,922 @@ +/* + * 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.table.api; + +import org.apache.flink.annotation.PublicEvolving; +import org.apache.flink.table.expressions.Expression; +import org.apache.flink.table.functions.TableFunction; +import org.apache.flink.table.functions.TemporalTableFunction; +import org.apache.flink.table.sinks.TableSink; + +/** + * A Table is the core component of the Table API. + * Similar to how the batch and streaming APIs have DataSet and DataStream, + * the Table API is built around {@link Table}. + * + * <p>Use the methods of {@link Table} to transform data. Use {@code TableEnvironment} to convert a + * {@link Table} back to a {@code DataSet} or {@code DataStream}. + * + * <p>When using Scala a {@link Table} can also be converted using implicit conversions. + * + * <p>Java Example: + * + * <pre> + * {@code + * ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); + * BatchTableEnvironment tEnv = BatchTableEnvironment.create(env); + * + * DataSet<Tuple2<String, Integer>> set = ... + * tEnv.registerTable("MyTable", set, "a, b"); + * + * Table table = tEnv.scan("MyTable").select(...); + * ... + * Table table2 = ... + * DataSet<MyType> set2 = tEnv.toDataSet(table2, MyType.class); + * } + * </pre> + * + * <p>Scala Example: + * + * <pre> + * {@code + * val env = ExecutionEnvironment.getExecutionEnvironment + * val tEnv = BatchTableEnvironment.create(env) + * + * val set: DataSet[(String, Int)] = ... + * val table = set.toTable(tEnv, 'a, 'b) + * ... + * val table2 = ... + * val set2: DataSet[MyType] = table2.toDataSet[MyType] + * } + * </pre> + * + * <p>Operations such as {@code join}, {@code select}, {@code where} and {@code groupBy} either + * take arguments in a Scala DSL or as an expression String. Please refer to the documentation for + * the expression syntax. + * Review comment: nit: empty line ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
