flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-4541) Support for SQL NOT IN operator
Date Thu, 17 Nov 2016 11:36:00 GMT

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

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

Github user fhueske commented on the issue:

    https://github.com/apache/flink/pull/2811
  
    Thanks for the pull request @AlexanderShoshin! The overall approach is good. We need to
fix a few things in the optimizer rule and I would like to use a `Map` instead of a `Cross`
to execute the `DataSetSingleRowCross`. `Map` is much more lightweight than `Cross`.
    
    Thanks, Fabian


> Support for SQL NOT IN operator
> -------------------------------
>
>                 Key: FLINK-4541
>                 URL: https://issues.apache.org/jira/browse/FLINK-4541
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Timo Walther
>            Assignee: Alexander Shoshin
>
> This should work:
> {code}
> def main(args: Array[String]): Unit = {
>     // set up execution environment
>     val env = ExecutionEnvironment.getExecutionEnvironment
>     val tEnv = TableEnvironment.getTableEnvironment(env)
>     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)
>     tEnv.registerTable("WordCount2", tEnv.fromDataSet(input, 'word, 'frequency).select('word).filter('word
!== "hello"))
>     // run a SQL query on the Table and retrieve the result as a new Table
>     val table = tEnv.sql("SELECT word, SUM(frequency) FROM WordCount WHERE word NOT IN
(SELECT word FROM WordCount2) GROUP BY word")
>     table.toDataSet[WC].print()
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message