[jira] [Commented] (FLINK-9699) Add api to replace registered table

2021-04-29 Thread Flink Jira Bot (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17336614#comment-17336614
 ] 

Flink Jira Bot commented on FLINK-9699:
---

This issue was labeled "stale-major" 7 ago and has not received any updates so 
it is being deprioritized. If this ticket is actually Major, please raise the 
priority and ask a committer to assign you the issue or revive the public 
discussion.


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>  Components: Table SQL / API
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available, stale-major
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2021-04-22 Thread Flink Jira Bot (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17328610#comment-17328610
 ] 

Flink Jira Bot commented on FLINK-9699:
---

This major issue is unassigned and itself and all of its Sub-Tasks have not 
been updated for 30 days. So, it has been labeled "stale-major". If this ticket 
is indeed "major", please either assign yourself or give an update. Afterwards, 
please remove the label. In 7 days the issue will be deprioritized.

> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>  Components: Table SQL / API
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available, stale-major
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-12-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16716286#comment-16716286
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

zjffdu commented on issue #6236: [FLINK-9699] [table] Add api to replace 
registered table
URL: https://github.com/apache/flink/pull/6236#issuecomment-446082836
 
 
   @hequn8128 @yanghua PR is updated, could you help review it ? Thanks


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Assignee: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-11-06 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16677502#comment-16677502
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

zjffdu commented on issue #6236: [FLINK-9699] [table] Add api to replace 
registered table
URL: https://github.com/apache/flink/pull/6236#issuecomment-436471468
 
 
   Thanks @hequn8128 @yanghua `registerOrReplaceXXX` make sense for me. I will 
update the PR.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Assignee: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-11-06 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16676878#comment-16676878
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

yanghua commented on issue #6236: [FLINK-9699] [table] Add api to replace 
registered table
URL: https://github.com/apache/flink/pull/6236#issuecomment-436288232
 
 
   @hequn8128 I agree with you. Actually, I have given a similar suggestion 
about `CREATE VIEW` in SQL client. See 
[FLINK-10420](https://issues.apache.org/jira/browse/FLINK-10420?filter=-1). cc 
@twalthr 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Assignee: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-11-06 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16676842#comment-16676842
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

hequn8128 commented on issue #6236: [FLINK-9699] [table] Add api to replace 
registered table
URL: https://github.com/apache/flink/pull/6236#issuecomment-436275448
 
 
   @zjffdu Thanks for the PR. I think this feature is very useful. I haven't 
taken a deep look at the code. Considering the api, how about change these 
`register()` functions with replace parameter to `registerOrReplaceXXX()` ?  It 
makes our api more alignment with SQL, such as CREATE OR REPLACE. What do you 
guys think here? @twalthr @yanghua 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Assignee: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-08-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16568208#comment-16568208
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

twalthr commented on issue #6236: [FLINK-9699] [table] Add api to replace 
registered table
URL: https://github.com/apache/flink/pull/6236#issuecomment-410253759
 
 
   Thanks for the PR @zjffdu. The way how tables are registered have change 
recently due to the new unified table sources/sinks. Could you update your PR? 
I will review it then.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531586#comment-16531586
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199860344
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
 ---
@@ -118,15 +195,19 @@ class BatchTableEnvironment(
 * @param name The name under which the [[DataSet]] is registered in 
the catalog.
 * @param dataSet The [[DataSet]] to register.
 * @param fields The field names of the registered table.
+* @param replace Whether to replace the registered table
--- End diff --

end with point.


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531578#comment-16531578
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199857354
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala
 ---
@@ -300,9 +307,10 @@ abstract class BatchTableEnvironment(
 * @param dataSet The [[DataSet]] to register as table in the catalog.
 * @param fields The field expressions to define the field names of the 
table.
 * @tparam T The type of the [[DataSet]].
+* @param replace Whether to replace the registered table
--- End diff --

end with point


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531583#comment-16531583
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199857390
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
 ---
@@ -163,12 +164,14 @@ abstract class StreamTableEnvironment(
 * @param fieldNames The field names to register with the [[TableSink]].
 * @param fieldTypes The field types to register with the [[TableSink]].
 * @param tableSink The [[TableSink]] to register.
+* @param replace  Whether to replace the registered table
--- End diff --

end with point


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531581#comment-16531581
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199857340
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala
 ---
@@ -280,16 +284,19 @@ abstract class BatchTableEnvironment(
 * @param name The name under which the table is registered in the 
catalog.
 * @param dataSet The [[DataSet]] to register as table in the catalog.
 * @tparam T the type of the [[DataSet]].
+* @param replace Whether to replace the registered table
--- End diff --

end with point


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531579#comment-16531579
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199857801
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
 ---
@@ -433,9 +447,24 @@ abstract class TableEnvironment(val config: 
TableConfig) {
 * @param nameThe name under which the [[TableSource]] is 
registered.
 * @param tableSource The [[TableSource]] to register.
 */
-  def registerTableSource(name: String, tableSource: TableSource[_]): Unit 
= {
+  def registerTableSource(name: String,
+  tableSource: TableSource[_]): Unit = {
+registerTableSource(name, tableSource, false)
+  }
+
+  /**
+* Registers an external [[TableSource]] in this [[TableEnvironment]]'s 
catalog.
+* Registered tables can be referenced in SQL queries.
+*
+* @param nameThe name under which the [[TableSource]] is 
registered.
+* @param tableSource The [[TableSource]] to register.
+* @param replace Whether to replace the registered table
--- End diff --

end with a point


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531584#comment-16531584
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199858196
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
 ---
@@ -55,9 +55,22 @@ class BatchTableEnvironment(
 * @return The converted [[Table]].
 */
   def fromDataSet[T](dataSet: DataSet[T]): Table = {
+fromDataSet(dataSet, false)
+  }
 
+  /**
+* Converts the given [[DataSet]] into a [[Table]].
+*
+* The field names of the [[Table]] are automatically derived from the 
type of the [[DataSet]].
+*
+* @param dataSet The [[DataSet]] to be converted.
+* @tparam T The type of the [[DataSet]].
+* @param replace Whether to replace the registered table
--- End diff --

end with a point


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531590#comment-16531590
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199859899
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
 ---
@@ -77,15 +90,38 @@ class BatchTableEnvironment(
 * @return The converted [[Table]].
 */
   def fromDataSet[T](dataSet: DataSet[T], fields: String): Table = {
+
+fromDataSet(dataSet, fields, false)
+  }
+
+  /**
+* Converts the given [[DataSet]] into a [[Table]] with specified field 
names. And could
+* also replace the existing table if it is already registered.
+*
+* Example:
+*
+* {{{
+*   DataSet> set = ...
+*   Table tab = tableEnv.fromDataSet(set, "a, b", true)
+* }}}
+*
+* @param dataSet The [[DataSet]] to be converted.
+* @param fields The field names of the resulting [[Table]].
+* @tparam T The type of the [[DataSet]].
+* @param replace Whether to replace the registered table
--- End diff --

end with point.


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531582#comment-16531582
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199857432
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
 ---
@@ -415,6 +416,19 @@ abstract class TableEnvironment(val config: 
TableConfig) {
 */
   def registerTable(name: String, table: Table): Unit = {
 
+registerTable(name, table, false)
+  }
+
+  /**
+* Registers a [[Table]] under a unique name in the TableEnvironment's 
catalog.
--- End diff --

I think replace "under" to "with", would be better.


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531593#comment-16531593
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199860789
  
--- Diff: 
flink-libraries/flink-table/src/test/java/org/apache/flink/table/runtime/batch/sql/JavaSqlITCase.java
 ---
@@ -71,8 +71,10 @@ public void testValues() throws Exception {
// Calcite converts to decimals and strings with equal 
length
"1,Test ,true,1944-02-24,12.4445\n";
compareResultAsText(results, expected);
+   
}
 
+
--- End diff --

remove blank line


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531588#comment-16531588
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199860044
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
 ---
@@ -95,12 +131,53 @@ class BatchTableEnvironment(
 *
 * @param name The name under which the [[DataSet]] is registered in 
the catalog.
 * @param dataSet The [[DataSet]] to register.
+* @param replace Whether to replace the registered table
--- End diff --

end with point


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531576#comment-16531576
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199855960
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala
 ---
@@ -95,15 +95,17 @@ abstract class BatchTableEnvironment(
 *
 * @param nameThe name under which the [[TableSource]] is 
registered.
 * @param tableSource The [[TableSource]] to register.
+* @param replace Whether to replace the registered table
--- End diff --

end with point


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531587#comment-16531587
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199860444
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/BatchTableEnvironment.scala
 ---
@@ -53,12 +53,13 @@ class BatchTableEnvironment(
 *
 * @param dataSet The [[DataSet]] to be converted.
 * @tparam T The type of the [[DataSet]].
+* @param replace whether to replace the registered table
--- End diff --

end with point.


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531577#comment-16531577
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199857321
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala
 ---
@@ -145,12 +147,14 @@ abstract class BatchTableEnvironment(
 * @param fieldNames The field names to register with the [[TableSink]].
 * @param fieldTypes The field types to register with the [[TableSink]].
 * @param tableSink  The [[TableSink]] to register.
+* @param replaceWhether to replace the registered table
--- End diff --

end with point


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531585#comment-16531585
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199860145
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
 ---
@@ -95,12 +131,53 @@ class BatchTableEnvironment(
 *
 * @param name The name under which the [[DataSet]] is registered in 
the catalog.
 * @param dataSet The [[DataSet]] to register.
+* @param replace Whether to replace the registered table
 * @tparam T The type of the [[DataSet]] to register.
 */
   def registerDataSet[T](name: String, dataSet: DataSet[T]): Unit = {
 
+registerDataSet(name, dataSet, false)
+  }
+
+  /**
+* Registers the given [[DataSet]] as table in the
+* [[TableEnvironment]]'s catalog.
+* Registered tables can be referenced in SQL queries.
+*
+* The field names of the [[Table]] are automatically derived from the 
type of the [[DataSet]].
+*
+* @param name The name under which the [[DataSet]] is registered in 
the catalog.
+* @param dataSet The [[DataSet]] to register.
+* @param replace Whether to replace the registered table
--- End diff --

end with point.


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531589#comment-16531589
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199858297
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
 ---
@@ -77,15 +90,38 @@ class BatchTableEnvironment(
 * @return The converted [[Table]].
 */
   def fromDataSet[T](dataSet: DataSet[T], fields: String): Table = {
+
--- End diff --

remove blank line


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531591#comment-16531591
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199860548
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/BatchTableEnvironment.scala
 ---
@@ -94,11 +95,12 @@ class BatchTableEnvironment(
 * @param name The name under which the [[DataSet]] is registered in 
the catalog.
 * @param dataSet The [[DataSet]] to register.
 * @tparam T The type of the [[DataSet]] to register.
+* @param replace whether to replace the registered table
--- End diff --

end with point.


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531592#comment-16531592
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199860711
  
--- Diff: 
flink-libraries/flink-table/src/test/java/org/apache/flink/table/runtime/batch/sql/JavaSqlITCase.java
 ---
@@ -71,8 +71,10 @@ public void testValues() throws Exception {
// Calcite converts to decimals and strings with equal 
length
"1,Test ,true,1944-02-24,12.4445\n";
compareResultAsText(results, expected);
+   
--- End diff --

remove blank line


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531580#comment-16531580
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

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

https://github.com/apache/flink/pull/6236#discussion_r199857602
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
 ---
@@ -415,6 +416,19 @@ abstract class TableEnvironment(val config: 
TableConfig) {
 */
   def registerTable(name: String, table: Table): Unit = {
 
+registerTable(name, table, false)
+  }
+
+  /**
+* Registers a [[Table]] under a unique name in the TableEnvironment's 
catalog.
+* Registered tables can be referenced in SQL queries.
+*
+* @param name The name under which the table will be registered.
+* @param table The table to register.
+* @param replace  Whether to replace the registered table
--- End diff --

end with point.


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531562#comment-16531562
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

Github user yanghua commented on the issue:

https://github.com/apache/flink/pull/6236
  
@zjffdu test error, please recheck


> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread Jeff Zhang (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531027#comment-16531027
 ] 

Jeff Zhang commented on FLINK-9699:
---

Thanks [~fhueske], let's hold this ticket for now. I will try to look at the 
flink sql component and see how we do such redesign in a simple way. 

> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread Fabian Hueske (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531004#comment-16531004
 ] 

Fabian Hueske commented on FLINK-9699:
--

It might be possible to change the translation behavior, i.e., to immediately 
create a logical TableScan that references the correct DataSet / TableSource 
when the {{tEnv.scan()}} method is called.
That would require a bit of a redesign of the Table API translation phase. I'm 
not opposed to that, especially if we can improve the support for 
notebook-style environments. 

However, it might be a larger effort that would need to be carefully planned. 
For example, the Table API handles it's own validation.

> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-03 Thread Jeff Zhang (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16530922#comment-16530922
 ] 

Jeff Zhang commented on FLINK-9699:
---

[~fhueske] I don't know much about the internal mechanism of flink sql. But is 
it possible to translate which DataSet does MyT point to beforehand instead of 
delaying to converted into a DataStream/DataSet or emitted through a TableSink. 

> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-02 Thread Fabian Hueske (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16529664#comment-16529664
 ] 

Fabian Hueske commented on FLINK-9699:
--

I understand the motivation for this feature but I'm not sure whether we should 
add it.
Table API queries are translated when they are converted into a 
DataStream/DataSet or emitted through a TableSink.

By allowing to replace tables, the following code would behave unexpectedly or 
even throw an exception:

{code}
tEnv.registerTable("MyT", dataset);
Table t = tEnv.scan("MyT").select(). // ...;
tEnv.registerTable("MyT", dataset2, true);

DataSet res = tEnv.toDataSet(t, Row.class); // query will process 
dataset2. Might just be different data but also different schema
{code}

For SQL queries it works, because these are immediately translated into logical 
plan node which have a reference to the original table.

> Add api to replace registered table
> ---
>
> Key: FLINK-9699
> URL: https://issues.apache.org/jira/browse/FLINK-9699
> Project: Flink
>  Issue Type: Improvement
>Reporter: Jeff Zhang
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FLINK-9699) Add api to replace registered table

2018-07-02 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/FLINK-9699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16529495#comment-16529495
 ] 

ASF GitHub Bot commented on FLINK-9699:
---

GitHub user zjffdu opened a pull request:

https://github.com/apache/flink/pull/6236

[FLINK-9699]. Add api to replace registered table

*Thank you very much for contributing to Apache Flink - we are happy that 
you want to help us improve Flink. To help the community review your 
contribution in the best possible way, please go through the checklist below, 
which will get the contribution into a shape in which it can be best reviewed.*

*Please understand that we do not do this to make contributions to Flink a 
hassle. In order to uphold a high standard of quality for code contributions, 
while at the same time managing a large number of contributions, we need 
contributors to prepare the contributions well, and give reviewers enough 
contextual information for the review. Please also understand that 
contributions that do not follow this guide will take longer to review and thus 
typically be picked up with lower priority by the community.*

## Contribution Checklist

  - Make sure that the pull request corresponds to a [JIRA 
issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are 
made for typos in JavaDoc or documentation files, which need no JIRA issue.
  
  - Name the pull request in the form "[FLINK-] [component] Title of 
the pull request", where *FLINK-* should be replaced by the actual issue 
number. Skip *component* if you are unsure about which is the best component.
  Typo fixes that have no associated JIRA issue should be named following 
this pattern: `[hotfix] [docs] Fix typo in event time introduction` or 
`[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.

  - Fill out the template below to describe the changes contributed by the 
pull request. That will give reviewers the context they need to do the review.
  
  - Make sure that the change passes the automated tests, i.e., `mvn clean 
verify` passes. You can set up Travis CI to do that following [this 
guide](http://flink.apache.org/contribute-code.html#best-practices).

  - Each pull request should address only one issue, not mix up code from 
multiple issues.
  
  - Each commit in the pull request has a meaningful commit message 
(including the JIRA id)

  - Once all items of the checklist are addressed, remove the above text 
and this checklist, leaving only the filled out template below.


**(The sections below can be removed for hotfixes of typos)**

## What is the purpose of the change

*(For example: This pull request makes task deployment go through the blob 
server, rather than through RPC. That way we avoid re-transferring them on each 
deployment (during recovery).)*


## Brief change log

*(for example:)*
  - *The TaskInfo is stored in the blob store on job creation time as a 
persistent artifact*
  - *Deployments RPC transmits only the blob storage reference*
  - *TaskManagers retrieve the TaskInfo from the blob cache*


## Verifying this change

*(Please pick either of the following options)*

This change is a trivial rework / code cleanup without any test coverage.

*(or)*

This change is already covered by existing tests, such as *(please describe 
tests)*.

*(or)*

This change added tests and can be verified as follows:

*(example:)*
  - *Added integration tests for end-to-end deployment with large payloads 
(100MB)*
  - *Extended integration test for recovery after master (JobManager) 
failure*
  - *Added test that validates that TaskInfo is transferred only once 
across recoveries*
  - *Manually verified the change by running a 4 node cluser with 2 
JobManagers and 4 TaskManagers, a stateful streaming program, and killing one 
JobManager and two TaskManagers during the execution, verifying that recovery 
happens correctly.*

## Does this pull request potentially affect one of the following parts:

  - Dependencies (does it add or upgrade a dependency): (yes / no)
  - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (yes / no)
  - The serializers: (yes / no / don't know)
  - The runtime per-record code paths (performance sensitive): (yes / no / 
don't know)
  - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / no / don't know)
  - The S3 file system connector: (yes / no / don't know)

## Documentation

  - Does this pull request introduce a new feature? (yes / no)
  - If yes, how is the feature documented? (not applicable / docs / 
JavaDocs / not