[
https://issues.apache.org/jira/browse/FLINK-8607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16358472#comment-16358472
]
ASF GitHub Bot commented on FLINK-8607:
---------------------------------------
GitHub user twalthr opened a pull request:
https://github.com/apache/flink/pull/5441
[FLINK-8607] [table] Add a basic embedded SQL CLI client
## What is the purpose of the change
This PR implements the first part of the implementation plan described in
FLIP-24.
```
Goal: Add the basic features to play around with Flink's streaming SQL.
- Add CLI component that reads the configuration files
- "Pre-registered table sources"
- "Job parameters"
- Add executor for retrieving pre-flight information and corresponding CLI
SQL parser
- SHOW TABLES
- DESCRIBE TABLE
- EXPLAIN
- Add streaming append query submission to executor
- Submit jars and run SELECT query using the ClusterClient
- Collect results on heap and serve them on the CLI side (Internal Mode
with SELECT)
- SOURCE (for executing a SQL statement stored in a local file)
```
Additionally, this PR also supports retraction queries and the SET
operation for setting properties.
The client can be started using `./bin/sql-client.sh embedded`.
A table source must be defined in `./conf/sql-client-defaults.yaml` (for
example a CSV table source, an example can be found in the test resources
directory).
The client supports two modes for viewing results. A `changelog` mode or
`table` mode. They can be selected by setting the `execution.result-mode`
property.
The code is still work in progress. There are a couple of things that can
be improved:
- Add more logging instead of swallowing exceptions
- Use Flink's ConfigOptions where applicable (e.g. for better default value
handling and validation)
- Maybe make the record result retrieval blocking?
- Tests for the LocalExecutor
- Some basic tests for other classes (maybe for CLI classes as well?)
- More deployment options (support for YARN, FLIP-6?)
- Documentation
## Brief change log
- New module `flink-sql-client`
- New executable script in `flink/bin`
- Minor visibility changes in other modules
## Verifying this change
Manually verified. Further tests will follow.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): yes
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Yarn/Mesos, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? yes
- If yes, how is the feature documented? not documented
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/twalthr/flink FLINK-8607
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/5441.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 #5441
----
commit 17b6b6d8b8804382b7b855033c370ffb4fd673ac
Author: twalthr <twalthr@...>
Date: 2017-12-07T12:46:31Z
[FLINK-8607] [table] Add a basic embedded SQL CLI client
----
> Add a basic embedded SQL CLI client
> -----------------------------------
>
> Key: FLINK-8607
> URL: https://issues.apache.org/jira/browse/FLINK-8607
> Project: Flink
> Issue Type: Sub-task
> Components: Table API & SQL
> Reporter: Timo Walther
> Assignee: Timo Walther
> Priority: Major
>
> This issue describes the Implementation Plan 1 of FLIP-24.
> Goal: Add the basic features to play around with Flink's streaming SQL.
> {code}
> - Add CLI component that reads the configuration files
> - "Pre-registered table sources"
> - "Job parameters"
> - Add executor for retrieving pre-flight information and corresponding CLI
> SQL parser
> - SHOW TABLES
> - DESCRIBE TABLE
> - EXPLAIN
> - Add streaming append query submission to executor
> - Submit jars and run SELECT query using the ClusterClient
> - Collect results on heap and serve them on the CLI side (Internal Mode with
> SELECT)
> - SOURCE (for executing a SQL statement stored in a local file)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)