[
https://issues.apache.org/jira/browse/FLINK-3727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15250559#comment-15250559
]
ASF GitHub Bot commented on FLINK-3727:
---------------------------------------
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?
> Add support for embedded streaming SQL (projection, filter, union)
> ------------------------------------------------------------------
>
> Key: FLINK-3727
> URL: https://issues.apache.org/jira/browse/FLINK-3727
> Project: Flink
> Issue Type: Sub-task
> Components: Table API
> Affects Versions: 1.1.0
> Reporter: Vasia Kalavri
> Assignee: Vasia Kalavri
>
> Similar to the support for SQL embedded in batch Table API programs, this
> issue tracks the support for SQL embedded in stream Table API programs. The
> only currently supported operations on streaming Tables are projection,
> filtering, and union.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)