[
https://issues.apache.org/jira/browse/FLINK-9059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16420247#comment-16420247
]
ASF GitHub Bot commented on FLINK-9059:
---------------------------------------
Github user suez1224 commented on a diff in the pull request:
https://github.com/apache/flink/pull/5758#discussion_r178244473
--- Diff:
flink-libraries/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
---
@@ -29,38 +30,47 @@
/**
* Environment configuration that represents the content of an environment
file. Environment files
- * define sources, execution, and deployment behavior. An environment
might be defined by default or
+ * define tables, execution, and deployment behavior. An environment might
be defined by default or
* as part of a session. Environments can be merged or enriched with
properties (e.g. from CLI command).
*
* <p>In future versions, we might restrict the merging or enrichment of
deployment properties to not
* allow overwriting of a deployment by a session.
*/
public class Environment {
- private Map<String, Source> sources;
+ private Map<String, TableDescriptor> tables;
private Execution execution;
private Deployment deployment;
public Environment() {
- this.sources = Collections.emptyMap();
+ this.tables = Collections.emptyMap();
this.execution = new Execution();
this.deployment = new Deployment();
}
- public Map<String, Source> getSources() {
- return sources;
+ public Map<String, TableDescriptor> getTables() {
+ return tables;
}
- public void setSources(List<Map<String, Object>> sources) {
- this.sources = new HashMap<>(sources.size());
- sources.forEach(config -> {
- final Source s = Source.create(config);
- if (this.sources.containsKey(s.getName())) {
- throw new SqlClientException("Duplicate source
name '" + s + "'.");
+ public void setTables(List<Map<String, Object>> tables) {
+ this.tables = new HashMap<>(tables.size());
+ tables.forEach(config -> {
+ if (!config.containsKey(TableDescriptor.TABLE_TYPE())) {
+ throw new SqlClientException("The 'type'
attribute of a table is missing.");
--- End diff --
Yes, the values can be (source, sink and both), please see
https://issues.apache.org/jira/browse/FLINK-8866.
> Add support for unified table source and sink declaration in environment file
> -----------------------------------------------------------------------------
>
> Key: FLINK-9059
> URL: https://issues.apache.org/jira/browse/FLINK-9059
> Project: Flink
> Issue Type: Task
> Components: Table API & SQL
> Reporter: Shuyi Chen
> Assignee: Shuyi Chen
> Priority: Major
> Fix For: 1.5.0
>
>
> 1) Add a common property called "type" with single value 'source'.
> 2) in yaml file, replace "sources" with "tables".
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)