Skip to content

Commit

Permalink
[hotfix][examples-table] Update registerDataSet to createTemporaryView
Browse files Browse the repository at this point in the history
  • Loading branch information
twalthr committed Nov 26, 2019
1 parent d95e2c1 commit 9505b0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public static void main(String[] args) throws Exception {
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 9505b0e

Please sign in to comment.