You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/04/07 17:14:25 UTC
[jira] [Commented] (FLINK-3640) Add support for SQL queries in
DataSet programs
[ https://issues.apache.org/jira/browse/FLINK-3640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15230383#comment-15230383 ]
ASF GitHub Bot commented on FLINK-3640:
---------------------------------------
GitHub user vasia opened a pull request:
https://github.com/apache/flink/pull/1862
[FLINK-3640] Add support for SQL in DataSet programs
This PR adds basic support for batch SQL queries embedded in Table API programs.
In order to run a SQL query, a `DataSet` or `Table` needs to be registered in the `TableEnvironment` and then the query is executed using the `sql` method:
```
val tEnv = getScalaTableEnvironment
val t = getDataSet(env).toTable
tEnv.registerTable("MyTable", t)
val sqlQuery = "SELECT * FROM MyTable"
val result = tEnv.sql(sqlQuery)
```
The result of the `sql` method is a `Table` which can be used in subsequent Table API or SQL queries.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/vasia/flink batch-sql
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/1862.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1862
----
----
> 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)