You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tw...@apache.org on 2019/11/26 12:07:52 UTC

[flink] branch master updated: [hotfix][examples-table] Update registerDataSet to createTemporaryView

This is an automated email from the ASF dual-hosted git repository.

twalthr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 9505b0e  [hotfix][examples-table] Update registerDataSet to createTemporaryView
9505b0e is described below

commit 9505b0e7007d580dcd147befd8dfd91893517496
Author: Timo Walther <tw...@apache.org>
AuthorDate: Tue Nov 26 13:05:27 2019 +0100

    [hotfix][examples-table] Update registerDataSet to createTemporaryView
---
 .../main/java/org/apache/flink/table/examples/java/WordCountSQL.java  | 4 ++--
 .../scala/org/apache/flink/table/examples/scala/WordCountSQL.scala    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java b/flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java
index d724561..20618d8 100644
--- a/flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java
+++ b/flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/WordCountSQL.java
@@ -48,8 +48,8 @@ public class WordCountSQL {
 			new WC("Ciao", 1),
 			new WC("Hello", 1));
 
-		// register the DataSet as table "WordCount"
-		tEnv.registerDataSet("WordCount", input, "word, frequency");
+		// register the DataSet as a view "WordCount"
+		tEnv.createTemporaryView("WordCount", input, "word, frequency");
 
 		// run a SQL query on the Table and retrieve the result as a new Table
 		Table table = tEnv.sqlQuery(
diff --git a/flink-examples/flink-examples-table/src/main/scala/org/apache/flink/table/examples/scala/WordCountSQL.scala b/flink-examples/flink-examples-table/src/main/scala/org/apache/flink/table/examples/scala/WordCountSQL.scala
index 2861c2c..c95746e 100644
--- a/flink-examples/flink-examples-table/src/main/scala/org/apache/flink/table/examples/scala/WordCountSQL.scala
+++ b/flink-examples/flink-examples-table/src/main/scala/org/apache/flink/table/examples/scala/WordCountSQL.scala
@@ -43,8 +43,8 @@ object WordCountSQL {
 
     val input = env.fromElements(WC("hello", 1), WC("hello", 1), WC("ciao", 1))
 
-    // register the DataSet as table "WordCount"
-    tEnv.registerDataSet("WordCount", input, 'word, 'frequency)
+    // register the DataSet as a view "WordCount"
+    tEnv.createTemporaryView("WordCount", input, 'word, 'frequency)
 
     // run a SQL query on the Table and retrieve the result as a new Table
     val table = tEnv.sqlQuery("SELECT word, SUM(frequency) FROM WordCount GROUP BY word")