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

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

Github user rmetzger commented on the pull request:

    https://github.com/apache/flink/pull/1862#issuecomment-206986445
  
    Awesome! Really cool to see that coming to Flink.
    I played a bit around with it and it seems to work ;)
    
    ```java
    Table table = tableEnv.fromDataSet(input);
    tableEnv.registerTable("tab", table);
    tableEnv.registerTable("tab1", table);
    Table res = tableEnv.sql("SELECT COUNT(tab1.acount) AS acount, tab.word " +
        "FROM tab, tab1 " +
        "WHERE tab.word = tab1.word GROUP BY tab.word");
    res = res.filter("acount > 2");
    ```
    
    ```java
    Table res = tableEnv.sql("SELECT COUNT(acount) AS acount, word " +
        "FROM (SELECT * FROM tab WHERE acount = 1 ) " +
        "GROUP BY word");
    ```



> Add support for SQL queries in DataSet programs
> -----------------------------------------------
>
>                 Key: FLINK-3640
>                 URL: https://issues.apache.org/jira/browse/FLINK-3640
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API
>    Affects Versions: 1.1.0
>            Reporter: Vasia Kalavri
>            Assignee: Vasia Kalavri
>
> This issue covers the task of supporting SQL queries embedded in DataSet 
> programs. In this mode, the input and output of a SQL query is a Table. For 
> this issue, we need to make the following additions to the Table API:
> - add a {{tEnv.sql(query: String): Table}} method for converting a query 
> result into a Table
> - integrate Calcite's SQL parser into the batch Table API translation process.



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

Reply via email to